This is my third post of the series of the Number Converter for Windows Phone 7 sourcecode . In my previous posts i talked about
- Number Converter for WP7 – How to convert Decimal Number to Binary , HexaDecimal and Octal Number using C# ?
- How to convert Binary Number to Decimal , HexaDecimal and Octal Number using C# ?
In this blog post , i describe or share the code that converts a Octal Number to Decimal , HexaDecimal and Binary Number using C# in Windows Phone 7 .
public static class OctalConverter
{
/// <summary>
/// Octals to binary.
/// </summary>
/// <param name="OctalNumber">The octal number.</param>
/// <returns></returns>
public static string OctalToBinary(string OctalNumber)
{
Int64 DecimalNumber = OctalToDecimal(OctalNumber);
string retVal = "";
retVal = DecimalConverter.DecimalToBinary(DecimalNumber);
return retVal;
}
/// <summary>
/// Octals to decimal.
/// </summary>
/// <param name="OctalNumber">The octal number.</param>
/// <returns></returns>
public static Int64 OctalToDecimal(string OctalNumber)
{
return Convert.ToInt64(Convert.ToString(Convert.ToInt64(OctalNumber,8), 10));
}
/// <summary>
/// Octals to hexa.
/// </summary>
/// <param name="OctalNumber">The octal number.</param>
/// <returns></returns>
public static string OctalToHexa(string OctalNumber)
{
Int64 DecimalNumber = OctalToDecimal(OctalNumber);
string retVal = "";
retVal = DecimalConverter.DecimalToHex(DecimalNumber);
return retVal;
}
}
DecimalConverter is a static class that was described in my earlier blog post is again used . If you noticed the above sourcecode , i have tried to the .NET framework function to convert the number instead of writing my own logic …

5 comments
How to convert Octal Number to Decimal ,... | .NET and C# | Syngu
[...] aboutNumber Converter for WP7 – How to convert Decimal Number to Binary , HexaDecimal and… Read more… Categories: .NET C# Share | Related [...]
Sep 7, 2011
Rob
Here is an on-line binary tutor.
http://justwebware.com/bitwise/bitwise.html
Sep 9, 2011
How to convert HexaDecimal Number to Decimal , Octal and Binary Number using C# ? | Ginktage
[...] How to convert Octal Number to Decimal , HexaDecimal and Binary Number using C# ? [...]
Sep 13, 2011
How to convert HexaDecimal Number to Decimal , Octal and Binary Number using C | ProgramInDotnet
[...] How to convert Octal Number to Decimal , HexaDecimal and Binary Number using C# ? [...]
Oct 23, 2011
How to convert HexaDecimal Number to Decimal , Octal and Binary Number using C# ? | Windows Phone Rocks
[...] How to convert Octal Number to Decimal , HexaDecimal and Binary Number using C# ? [...]
Jan 26, 2012