This is a mirror of official site: http://jasper-net.blogspot.com/

How to convert Octal Number to Decimal , HexaDecimal and Binary Number using C# ?

| Thursday, September 8, 2011
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));
   }


Read more: Ginktage
QR: https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://www.ginktage.com/2011/09/how-to-convert-octal-number-to-decimal-hexadecimal-and-binary-number-using-c/

Posted via email from Jasper-net

0 comments: