is there any binary to decimal convertor class
-
is there any class that converts in different number system?
-
is there any class that converts in different number system?
Hi, numbers don't have a base, it is only when they are converted to/from strings that a base applies. have a look at Convert.ToInt32(String, Int32) and Convert.ToString(Int32, Int32) [and similar for other types] :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
Hi, numbers don't have a base, it is only when they are converted to/from strings that a base applies. have a look at Convert.ToInt32(String, Int32) and Convert.ToString(Int32, Int32) [and similar for other types] :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
no. i mean what if i want to convert FFFF to binary or octal or any other format?
-
no. i mean what if i want to convert FFFF to binary or octal or any other format?
you can convert "FFFF" to an int32 and then to "1111111111111111" or "00000000000000001111111111111111" with the methods I indicated earlier. or you can write your own code to convert one string in another, which is harder to do, and does not really offer any advantage. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
no. i mean what if i want to convert FFFF to binary or octal or any other format?
FFFF is already in the desired "format". You just need to choose the correct string format so you can see it in the desired representation.
Int32 i = 200;
String oct = Convert.ToString(i, 8); // gives "310".45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
is there any class that converts in different number system?
Check out this old article[^] of mine
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus) -
Check out this old article[^] of mine
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)thanks a lot