[Tutor] Rounding to n significant digits?

Dick Moores rdm at rcblue.com
Fri Jul 2 03:41:22 EDT 2004


Alan Gauld wrote at 00:15 7/2/2004:
> > ================================
> > round( x[, n])
> >
> > Return the floating point value x rounded to n digits after the
>decimal
> > ...
> > So that won't do it. "rounded to n digits AFTER the decimal point".
>
>Oops, sorry I got caught out too.
>
>I don't know of anything that rounds to n significant digits.
>Looks ike you need to roll your own, although a quick search
>on Google or the Vaults of Parnassus might be worthwhile first
>since its a non trivial task...

I'll give it a try. But I am surprised that Python doesn't have what I 
want. It seems to have everything else..

Thanks,

Dick 




More information about the Tutor mailing list