Can now set the double value precision.

This commit is contained in:
Benoît Blanchon
2014-07-03 13:35:39 +02:00
parent 2222714d68
commit 81c7b9f700
4 changed files with 35 additions and 33 deletions

View File

@ -22,7 +22,7 @@ size_t Print::write(const char* s)
size_t Print::print(double value, int digits)
{
char tmp[32];
sprintf(tmp, "%.*lg", digits, value);
sprintf(tmp, "%.*lg", digits+1, value);
return write(tmp);
}