Re: [Pharo-users] Printing numbers
On Tue, Feb 24, 2015 at 4:55 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
Hi guys,
I have quite some reports that print several numbers. Until now we were using the default #greaseString. However, we now need to be able to start printing nicer and customizable. For example, I may want to put a comma every 3 numbers and dots for the decimals. And choose how many decimals. And maybe also choose to use scientific notation, etc....
Also, I need this for both, Pharo and GemStone. I wish I don't have to start building yet again my own number formatting library... so.. is there something available I could take a look?
Thanks in advance,
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
This one may come handy. http://smalltalkhub.com/#!/~philippeback/HOExtras/packages/Printf Works like a C printf. Coupled with 'Blah {1} and {2}' format: { '5.2d' printf: aNumber. '%5s' printf: aString } it can go a long way. Phil
Nice. Good to know about. thanks, cam On Tue, Feb 24, 2015 at 3:49 PM, phil@highoctane.be <phil@highoctane.be> wrote:
This one may come handy.
http://smalltalkhub.com/#!/~philippeback/HOExtras/packages/Printf
Works like a C printf.
Coupled with 'Blah {1} and {2}' format: { '5.2d' printf: aNumber. '%5s' printf: aString } it can go a long way.
Phil
participants (3)
-
Cameron Sanders -
Mariano Martinez Peck -
phil@highoctane.be