Skip to content

Less surprising parseFloat() handling of multiple '.' #2280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
More sensible parseFloat handling for '.'
  • Loading branch information
AbstractBeliefs committed Sep 1, 2014
commit 7a7ed4819ff26fbd86033e3e363e458e8df6edcc
2 changes: 1 addition & 1 deletion hardware/arduino/cores/arduino/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ float Stream::parseFloat(char skipChar){
read(); // consume the character we got with peek
c = timedPeek();
}
while( (c >= '0' && c <= '9') || c == '.' || c == skipChar );
while( (c >= '0' && c <= '9') || (c == '.' && !isFraction) || c == skipChar );

if(isNegative)
value = -value;
Expand Down