|
@@ -2223,13 +2223,13 @@ char *ftostr32(const float& x) {
|
2223
|
2223
|
return conv;
|
2224
|
2224
|
}
|
2225
|
2225
|
|
2226
|
|
-// Convert signed float to string (len 5 or 6) with 1.234 / -1.234 format
|
2227
|
|
-char* ftostr43(const float& x) {
|
|
2226
|
+// Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
|
|
2227
|
+char* ftostr43(const float& x, char plus/*=' '*/) {
|
2228
|
2228
|
long xx = x * 1000;
|
2229
|
|
- char *conv_ptr = conv;
|
2230
|
|
- if (xx >= 0) {
|
2231
|
|
- conv_ptr++;
|
2232
|
|
- }
|
|
2229
|
+ if (xx == 0)
|
|
2230
|
+ conv[0] = ' ';
|
|
2231
|
+ else if (xx > 0)
|
|
2232
|
+ conv[0] = plus;
|
2233
|
2233
|
else {
|
2234
|
2234
|
xx = -xx;
|
2235
|
2235
|
conv[0] = '-';
|
|
@@ -2240,7 +2240,7 @@ char* ftostr43(const float& x) {
|
2240
|
2240
|
conv[4] = (xx / 10) % 10 + '0';
|
2241
|
2241
|
conv[5] = (xx) % 10 + '0';
|
2242
|
2242
|
conv[6] = 0;
|
2243
|
|
- return conv_ptr;
|
|
2243
|
+ return conv;
|
2244
|
2244
|
}
|
2245
|
2245
|
|
2246
|
2246
|
// Convert unsigned float to string with 1.23 format
|
|
@@ -2453,7 +2453,7 @@ char* ftostr52(const float& x) {
|
2453
|
2453
|
}
|
2454
|
2454
|
if (lcdDrawUpdate) {
|
2455
|
2455
|
float v = current_position[Z_AXIS] - MESH_HOME_SEARCH_Z;
|
2456
|
|
- lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43(v + (v < 0 ? -0.0001 : 0.0001)));
|
|
2456
|
+ lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43(v + (v < 0 ? -0.0001 : 0.0001), '+'));
|
2457
|
2457
|
}
|
2458
|
2458
|
static bool debounce_click = false;
|
2459
|
2459
|
if (LCD_CLICKED) {
|