-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
sprintf(,"%f",); does not work, gives back %f #341
Comments
This is a well known issue among arduino user On Tue, May 26, 2015, 5:22 PM holgerlembke notifications@github.com wrote:
|
And so we don't want to fix it? Or at least document it? Perhaps create a Wiki page with "things that don't work"... |
you can use this function in the meantime |
Thanks, but coding some float to string is not the problem. The problem is that every noob uses the printf/sprint with floats and wastes time to find the root of the problems, not really assuming that printf doesn't work with floats... |
I think *printf style functions are not really Arduino way of doing things. Having floats supported in printf would be nice for some use cases though.
|
I think you are right with the String class way to go. My "complain" is more about the lack of documentation and finding errors again and again that are well known. To others. |
Probably due to ignorance, but I prefer to use a big |
printf with %f not working with 2.2.0. That is fixed in beta? |
Any progress on this issue? Was trying to use a |
* As stated here esp8266/Arduino#341 the `%f` is not working on arduino. Lets use there provided workaround. Signed-off-by: nailyk-fr <nailyk_git@nailyk.fr>
void setup() {
Serial.begin(115200);
delay(5000);
float dog = 43.34567;
char *cat = new char[100] ;
sprintf(cat,"%f",dog);
Serial.println(cat);
}
void loop() {
delay(100);
}
Instead of a number I get "%f" back...
The text was updated successfully, but these errors were encountered: