-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Floating Point Conversions #27
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
Comments
You can try this:
I'm not 100% positive this is LGPL though. |
Yeah, and you obviously need to change the function name and change double to float. |
Thanks for the speedy reply.. If I cut and paste that function straight into my sketch, it works perfectly. I tried what you suggested, changed the name of the function to atof_internal, changed return type to float, -/+ changing internal types to float, and it does not compile... /Users/amelvin/Downloads/Arduino-espfinal.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: MQTT-Melvide_-_v1.0.2.cpp.elf section its out old friend sbrk... Im happy though as the function works just fine inserted into the sketch. cheers for your help |
I need to convert numbers entered in a browser (Strings) or sent by MQTT (char array) to a floating point number (double).
I've been trying and failing various ways, but I'm pretty new to C (only since i got hold of the beta for this) so i've failed.
Igrr has said that atof has not been implemented ... this is what is in core_esp8266_noniso.c
atol does work but I'd kinda like the decimals... ( i know i can just enter an integer and then divide...)
Does anyone have any ideas... or fancy giving me a quick patch for this.. I'd try.... infact i spent a few hours on it.. but I'm so new to arrays, pointers, and all this that i just fail....
Cheers
A
The text was updated successfully, but these errors were encountered: