printing Scientific notation of float

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

printing Scientific notation of float

HwaJong Oh
Hi,
Does Pharo have scientific float notation printing?
http://en.wikipedia.org/wiki/Scientific_notation

I want to control the length of string of a float in my GUI.

Thanks
HwaJong Oh
Reply | Threaded
Open this post in threaded view
|

Re: printing Scientific notation of float

hernanmd
If you mean

'"%e".' printf: 0.0000000061. -->  '"6.1".'

There is some support here: http://www.squeaksource.com/Printf.html

2011/8/30 HwaJong Oh <[hidden email]>:

> Hi,
> Does Pharo have scientific float notation printing?
> http://en.wikipedia.org/wiki/Scientific_notation
>
> I want to control the length of string of a float in my GUI.
>
> Thanks
> HwaJong Oh
>
> --
> View this message in context: http://forum.world.st/printing-Scientific-notation-of-float-tp3778559p3778559.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: printing Scientific notation of float

HwaJong Oh
The package is installed and working.
Thanks.
Reply | Threaded
Open this post in threaded view
|

bug report

HwaJong Oh
In reply to this post by hernanmd
'Here is a float "%e" and an integer "%d".' printf: #(0.000000000001 42).
evalutes to
 'Here is a float "1.0" and an integer "42".'

I think  'Here is a float "1.0e-12" and an integer "42".' is the right answer.