IT Community - Software Programming, Web Development and Technical Support

Decimal to any number system

This is a discussion on Decimal to any number system within the Adobe Flex Programming forums, part of the Web Development category; hey!... its very simple to get the binary value of a number in flex. i really wonder of this features ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Adobe Flex Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-17-2007, 12:37 AM
kbala kbala is offline
D-Web Trainee
 
Join Date: Mar 2007
Posts: 5
kbala is on a distinguished road
Lightbulb Decimal to any number system

hey!...

its very simple to get the binary value of a number in flex. i really wonder of this features in flex.

var n:Number = 8;
Alert.show(n.toString(2));

it returns 1000;

Same way:
To convert octal number, Alert.show(n.toString(8));.

To convert Hex number, Alert.show(n.toString(16));.


its very simple and will be very user full when you are working with maths oriented functionality


Thanks

KBala

Last edited by kbala : 07-17-2007 at 12:39 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-17-2007, 02:45 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Smile Re: Decimal to any number system

Yes Bala,

This is the sample one for understanding how the flex is very powerful development tool. Even in .NET also there wont be any functions like this. Now the flex is having the AS3 with more functionality added to it. So we will be having a lot advandage of using flex.

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-21-2007, 01:51 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Thumbs up Re: Decimal to any number system

Hi.....

.Net have lot of functions like these...... ".Net is an Ocean"

below few examples........

Converting decimal to binary in C#.NET
int a = 12;
MessageBox.Show(Convert.ToString(a, 2));

Converting decimal to octal in C#.NET
int a = 12;
MessageBox.Show(Convert.ToString(a, 8));

Converting decimal to HexaDecimal in C#.NET
int a = 12;
MessageBox.Show(Convert.ToString(a, 16));
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-30-2007, 01:49 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Post Re: Decimal to any number system

Yes,

But the thing is here every data types and objects itself have a convertion function toString which helps you to convert any type of objects to number or string. In .NET they have defined the separate class or module for the convertion. When calling the Convert object, what the compiler will do is it will load all the functions and properties of the Convert class and call your convertion function which will take a bit memory. Here we have just talked about how the flexible the program was. Really it is a good to understanding and do the coding. Anyway in each programming language, they are having the convertion functions. So we dont need to worry about it.

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a number of days to a date itbarota HTML, CSS and Javascript Coding Techniques 6 09-23-2008 01:38 AM
Difference between System.String and System.StringBuilder class? S.Vinothkumar C# Programming 1 10-29-2007 05:23 AM
How do I convert a Number into a String with exactly 2 decimal places? itbarota HTML, CSS and Javascript Coding Techniques 2 10-26-2007 05:22 AM
What’s the difference between the System.Array.CopyTo() and System.Array.Clone() ? Archer C# Programming 2 08-25-2007 03:00 AM
How to convert Decimal to Binary in Flash? kingmaker Flash Actionscript Programming 1 07-21-2007 02:48 AM


All times are GMT -7. The time now is 08:52 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0