Mantis - Squeak
Viewing Issue Advanced Details
2229 Kernel major always 11-14-05 18:49 12-19-05 17:05
renggli  
 
normal  
closed 3.8  
fixed  
none    
none 3.9  
0002229: Integer>>printOn:base:showRadix:
#printOn:base:showRadix: is buggy and does not work for radixes other than 10.

123 printPaddedWith: $0 to: 10 base: 2 -> doesn't work
123 printPaddedWith: $0 to: 10 base: 8 -> doesn't work
123 printPaddedWith: $0 to: 10 base: 10 -> works
123 printPaddedWith: $0 to: 10 base: 16 -> doesn't work
 SmallIntegerPrintPaddedWithFix-fbs.1.cs [^] (1,512 bytes) 12-08-05 14:09

Notes
(0003150)
laza   
11-28-05 13:12   
Better use printStringBase:length:padded: and friends

123 printStringBase: 2 length: 10 padded: true '0001111011'
123 printStringBase: 8 length: 10 padded: true '0000000173'
123 printStringBase: 10 length: 10 padded: true '0000000123'
123 printStringBase: 16 length: 10 padded: true '000000007B'
(0003228)
FrankShearar   
12-08-05 14:10   
With the proviso that I know very little about the many SmallInteger printing methods, I've assumed that #printPaddedWith:to:base: should output something like #printStringBase:padded: (as in laza's note below), the attached changeset will do the trick. The changeset contains a test as well, so it assumes the existence of SmallIntegerTest.
(0003359)
ducasse   
12-19-05 17:05   
in 6707