🚸 12345.6 num-to-string

This commit is contained in:
Scott Lahteine
2022-03-04 15:18:27 -06:00
parent 186d2ba6b4
commit b9cef2e2e3
5 changed files with 10 additions and 10 deletions

View File

@ -377,10 +377,10 @@ const char* ftostr53sign(const_float_t f) {
return conv;
}
// Convert unsigned float to string with ____4.5, __34.5, _234.5, 1234.5 format
const char* ftostr51rj(const_float_t f) {
// Convert unsigned float to string with ____5.6, ___45.6, __345.6, _2345.6, 12345.6 format
const char* ftostr61rj(const_float_t f) {
const long i = UINTFLOAT(f, 1);
conv[0] = ' ';
conv[0] = RJDIGIT(i, 100000);
conv[1] = RJDIGIT(i, 10000);
conv[2] = RJDIGIT(i, 1000);
conv[3] = RJDIGIT(i, 100);

View File

@ -113,8 +113,8 @@ const char* ftostr52sign(const_float_t x);
// Convert signed float to string with +12.345 format
const char* ftostr53sign(const_float_t f);
// Convert unsigned float to string with 1234.5 format omitting trailing zeros
const char* ftostr51rj(const_float_t x);
// Convert unsigned float to string with 12345.6 format omitting trailing zeros
const char* ftostr61rj(const_float_t x);
// Convert float to rj string with 123 or -12 format
FORCE_INLINE const char* ftostr3(const_float_t x) { return i16tostr3rj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }