[Mono-bugs] [Bug 25068] New - Error in Convert.ToString(value, base)

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
21 May 2002 18:07:42 -0000


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by ds99krha@thn.htu.se.

http://bugzilla.ximian.com/show_bug.cgi?id=25068

--- shadow/25068	Tue May 21 14:07:42 2002
+++ shadow/25068.tmp.12357	Tue May 21 14:07:42 2002
@@ -0,0 +1,71 @@
+Bug#: 25068
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: win2k/cygwin
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ds99krha@thn.htu.se               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: Error in Convert.ToString(value, base)
+
+Description of Problem:
+ 
+The specification says for Convert.ToString(int, int):
+
+"Converts the value of a 32-bit signed integer to its equivalent String 
+representation in a specified base"
+
+Doesn't happen, always tries to convert to base 10 from specified base. 
+
+Steps to reproduce the problem:
+Run this code
+
+short tmpShort = 1234;
+int tmpInt = 12345;
+long tmpLong = 123456;
+
+Console.WriteLine(Convert.ToString(tmpShort, 2));			
+Console.WriteLine(Convert.ToString(tmpShort, 8));
+Console.WriteLine(Convert.ToString(tmpShort, 16));
+Console.WriteLine(Convert.ToString(tmpInt, 2));			
+Console.WriteLine(Convert.ToString(tmpInt, 8));
+Console.WriteLine(Convert.ToString(tmpInt, 16));
+Console.WriteLine(Convert.ToString(tmpLong, 2));			
+Console.WriteLine(Convert.ToString(tmpLong, 8));
+Console.WriteLine(Convert.ToString(tmpLong, 16));
+
+Actual Results:
+
+26
+668
+4660
+57
+5349
+74565
+120
+42798
+1193046
+
+Expected Results:
+
+10011010010
+2322
+4d2
+11000000111001
+30071
+3039
+11110001001000000
+361100
+1e240
+
+How often does this happen? 
+All the time
+
+Additional Information: