Fw: value()

new topic     » topic index » view thread      » older message » newer message

On Tue, 18 Feb 2003 13:50:48 +1100, Derek Parnell <ddparnell at bigpond.com> 
wrote:
>
> Actually, "%g" truncates digits so I never use it anymore.
>

I stand corrected. I haven't been using "%g" correctly all this time. This 
will work for both integers and floating point values...

      x = sprintf("%.16g",SOMEVAL)

It displays it at maximum precision which is 16 digits with trailing zeros 
removed and leading spaces removed.
-- 
 
 cheers,
Derek Parnell

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu