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 › Having float in variable but showin rounded value
Page Index Toggle Pages: 1
Having float in variable but showin rounded value (Read 548 times)
Having float in variable but showin rounded value
Nov 23rd, 2009, 12:28am
 
Hi,
I am writing a program showing measured data submitted by arduino.
The data submitted are float (e.g. 12,4798), but I want to show 12,5 only via the "text" function.
The float shall remain unchanged as I want to record them later in full accuracy.

Is there a method to do so?
Re: Having float in variable but showin rounded value
Reply #1 - Nov 23rd, 2009, 1:00am
 
you can define how a float should be converted to a string using
http://processing.org/reference/nf_.html etc...
Page Index Toggle Pages: 1