Correct range of LCD axis step editing (#13727)

This commit is contained in:
Marcio Teixeira
2019-04-16 14:45:31 -06:00
committed by Scott Lahteine
parent ab8052887f
commit 866e2d41dc
5 changed files with 26 additions and 22 deletions

View File

@ -264,15 +264,15 @@ void safe_delay(millis_t ms) {
return conv;
}
// Convert unsigned float to string with 1234.56 format omitting trailing zeros
char* ftostr62rj(const float &f) {
const long i = ((f < 0 ? -f : f) * 1000 + 5) / 10;
conv[0] = RJDIGIT(i, 100000);
// Convert unsigned float to string with 1234.5 format omitting trailing zeros
char* ftostr51rj(const float &f) {
const long i = ((f < 0 ? -f : f) * 100 + 5) / 10;
conv[0] = ' ';
conv[1] = RJDIGIT(i, 10000);
conv[2] = RJDIGIT(i, 1000);
conv[3] = DIGIMOD(i, 100);
conv[4] = '.';
conv[5] = DIGIMOD(i, 10);
conv[3] = RJDIGIT(i, 100);
conv[4] = DIGIMOD(i, 10);
conv[5] = '.';
conv[6] = DIGIMOD(i, 1);
return conv;
}

View File

@ -106,8 +106,8 @@ inline void serial_delay(const millis_t ms) {
// Convert signed float to string with +123.45 format
char* ftostr52sign(const float &x);
// Convert unsigned float to string with 1234.56 format omitting trailing zeros
char* ftostr62rj(const float &x);
// Convert unsigned float to string with 1234.5 format omitting trailing zeros
char* ftostr51rj(const float &x);
// Convert float to rj string with 123 or -12 format
FORCE_INLINE char* ftostr3(const float &x) { return i16tostr3(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }