Round all floats in string conversion functions (#10566)

This commit is contained in:
Scott Lahteine
2018-04-29 00:51:36 -05:00
committed by GitHub
parent 3f68203324
commit 9e0d99c0c6
6 changed files with 22 additions and 22 deletions

View File

@@ -57,7 +57,7 @@ void safe_delay(millis_t ms);
char* itostr3left(const int xx);
// Convert signed int to rj string with _123, -123, _-12, or __-1 format
char *itostr4sign(const int x);
char* itostr4sign(const int x);
// Convert unsigned float to string with 1.23 format
char* ftostr12ns(const float &x);
@@ -87,14 +87,14 @@ void safe_delay(millis_t ms);
char* ftostr62rj(const float &x);
// Convert float to rj string with 123 or -12 format
FORCE_INLINE char *ftostr3(const float &x) { return itostr3((int)x); }
FORCE_INLINE char* ftostr3(const float &x) { return itostr3(int(FIXFLOAT(x))); }
#if ENABLED(LCD_DECIMAL_SMALL_XY)
// Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format
char *ftostr4sign(const float &fx);
char* ftostr4sign(const float &fx);
#else
// Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format
FORCE_INLINE char *ftostr4sign(const float &x) { return itostr4sign((int)x); }
FORCE_INLINE char* ftostr4sign(const float &x) { return itostr4sign(int(FIXFLOAT(x))); }
#endif
#endif // ULTRA_LCD