Go Down

Topic: Serial.parseFloat with leading decimal (Read 112 times) previous topic - next topic


I just ran into the issue of parseFloat not seeing a leading decimal.  Trying to get a user to always enter 0.2 is going to be a problem.  I did a Google search for the issue and was led to:


which implies to me that the issue was resolved. Am I not understanding the github comments or is something else going on?  I'm using one of the later 1.6.7 hourly builds.



As a workaround, you could do something like this:

   char ascfloat [20];
   if (ascfloat[0] == '.')
        memmove (&ascfloat[1], &ascfloat[0], 1+strlen(ascfloat));
        ascfloat [0] = '0';


Maybe you could make a post in my patch for this to help encourage the Arduino team to merge it. I've had  fix for this and other parseFloat/Int issues open for five months now.


This seems to be wanted by many, we just need to show them this fact.


Just downloaded the nightly build and things are working just fine.
Thanks for the patch.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131