[Newbies] Re: Number formatting printf/sprintf for Squeak?

Zulq Alam me at zulq.net
Tue Feb 17 00:27:13 UTC 2009


Hi Lukas,

Lukas Renggli wrote:
> 
> testSwissCurrency
> 	| printer |
> 	printer := WASequentialPrinter new , 'CHF ' , WASignPrinter new ,
> (WANumberPrinter new separator: $'; precision: 2; accuracy: 0.05;
> yourself).
> 	
> 	self assert: (printer print: 12.34) = 'CHF 12.35'.
> 	self assert: (printer print: -12.39) = 'CHF -12.40'

Are there any plans to develop this into a more compact form?

For example (ugly, sorry!): 'CHF {f+-,.05}' % #(12.34).

I'm always disappointed with Squeak's string formatting/generation 
facilities and if Seaside has this framework, maybe it is a good base 
for compact string format language?

Thanks,
Zulq.


More information about the Beginners mailing list