We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Setting precision
Page Index Toggle Pages: 1
Setting precision (Read 359 times)
Setting precision
Mar 19th, 2006, 2:25am
 
Im wondering what the syntax is for setting a float to a precision of a certain amount

ie

float myFloat = 4.99999

and you want to just make it 5.0
Re: Setting precision
Reply #1 - Mar 19th, 2006, 5:22am
 
formatting for ouput? you're probably looking for nf().
Page Index Toggle Pages: 1