Add Laser Based I2C Ammeter Feature (#21835)

This commit is contained in:
Mike La Spina
2021-06-07 14:15:09 -05:00
committed by Scott Lahteine
parent a3063a9392
commit 2fd9971f41
12 changed files with 314 additions and 34 deletions

View File

@ -217,6 +217,15 @@ const char* ftostr41ns(const_float_t f) {
return &conv[2];
}
// Convert unsigned float to string with 123 format
const char* ftostr3ns(const_float_t f) {
const long i = UINTFLOAT(f, 3);
conv[4] = DIGIMOD(i, 100);
conv[5] = DIGIMOD(i, 10);
conv[6] = DIGIMOD(i, 1);
return &conv[4];
}
// Convert signed float to fixed-length string with 12.34 / _2.34 / -2.34 or -23.45 / 123.45 format
const char* ftostr42_52(const_float_t f) {
if (f <= -10 || f >= 100) return ftostr52(f); // -23.45 / 123.45

View File

@ -74,6 +74,9 @@ const char* ftostr31ns(const_float_t x);
// Convert unsigned float to string with 123.4 format
const char* ftostr41ns(const_float_t x);
// Convert unsigned float to string with 123 format
const char* ftostr3ns(const_float_t x);
// Convert signed float to fixed-length string with 12.34 / _2.34 / -2.34 or -23.45 / 123.45 format
const char* ftostr42_52(const_float_t x);