[Tutor] greater precision?

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Oct 29 16:45:26 CET 2012


On 29/10/2012 12:14, John Collins wrote:
> Indeed! As you saw, some outputs are, and really must be output as
> integers. A  1 with a decimal point followed by 15 0's would make a real
> mess of the face/vertex designation table. So I have to be careful where
> I invoke
> output.write("{0:.15f}".format(x))
> or similar, ie, that it operates only on the values I'd like output
> that way.
>

If you're more comfortable with C you can use printf style formatting 
see http://docs.python.org/2/library/stdtypes.html#string-formatting

-- 
Cheers.

Mark Lawrence.



More information about the Tutor mailing list