mirror of
https://github.com/esp8266/Arduino.git
synced 2025-08-01 03:47:23 +03:00
More efficient dtostrf() emulation on ARM
This commit is contained in:
@ -20,11 +20,8 @@
|
|||||||
|
|
||||||
char *dtostrf (double val, signed char width, unsigned char prec, char *sout) {
|
char *dtostrf (double val, signed char width, unsigned char prec, char *sout) {
|
||||||
char fmt[20];
|
char fmt[20];
|
||||||
if (width<0) {
|
sprintf(fmt, "%%%d.%df", width, prec);
|
||||||
sprintf(fmt, "%%-%d.%df", width, prec);
|
|
||||||
} else {
|
|
||||||
sprintf(fmt, "%%%d.%df", width, prec);
|
|
||||||
}
|
|
||||||
sprintf(sout, fmt, val);
|
sprintf(sout, fmt, val);
|
||||||
return sout;
|
return sout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user