Replace ftostr62sign with ftostr62rj

`ftostr62sign()` is used only when displaing/editing
Steps/mm. A sign is not needed - the value is always positive.
Because the number part is long there is no't much place for the values name.
With this PR the is one more char for the name possible.
This commit is contained in:
AnHardt
2016-12-12 14:35:02 +01:00
parent 7c71bb2900
commit cd2b74e88d
5 changed files with 17 additions and 18 deletions

View File

@ -212,18 +212,17 @@ void safe_delay(millis_t ms) {
return conv;
}
// Convert signed float to string with +1234.56 format
char* ftostr62sign(const float& x) {
// Convert unsigned float to string with 1234.56 format omitting trailing zeros
char* ftostr62rj(const float& x) {
long xx = abs(x * 100);
conv[0] = MINUSOR(xx, '+');
conv[1] = DIGIMOD(xx, 100000);
conv[2] = DIGIMOD(xx, 10000);
conv[3] = DIGIMOD(xx, 1000);
conv[4] = DIGIMOD(xx, 100);
conv[5] = '.';
conv[6] = DIGIMOD(xx, 10);
conv[7] = DIGIMOD(xx, 1);
conv[8] = '\0';
conv[0] = RJDIGIT(xx, 100000);
conv[1] = RJDIGIT(xx, 10000);
conv[2] = RJDIGIT(xx, 1000);
conv[3] = DIGIMOD(xx, 100);
conv[4] = '.';
conv[5] = DIGIMOD(xx, 10);
conv[6] = DIGIMOD(xx, 1);
conv[7] = '\0';
return conv;
}