Re: floats in (s)printf
- Posted by David Alan Gay <moggie at INTERLOG.COM> Mar 29, 1997
- 937 views
> i just noticed that printf and sprintf by default display like 6 > digits after the decimal place or something like that with %e, %f and %g... > i was wondering it were possible (practical) to have some way of > displaying just enough digits that would still give all the accuracy of the > number... i.e. if i were to do a printf(1,"%f",5.5) it would print out > "5.5", but if i were to do a printf(1,"%f",5.55555555555555555) it would > print out that number to 15 decimal places or whatever it is... you know > what i'm saying?? okay Well, Euphoria does allow specification of field width and decimal precision for displaying numbers. For example, %6.3f means a field width of 6 positions with a precision of 3 decimal points. I don't know if it goes to 15 decimal points however...never tried. Hope this helps David Gay http://www.interlog.com/~moggie/Euphoria "A Beginner's Guide To Euphoria"