Skip to content

Commit

Permalink
Do not remove trailing zeroes after the decimal point
Browse files Browse the repository at this point in the history
  • Loading branch information
puhitaku authored and danopernis committed Aug 14, 2024
1 parent 8169b60 commit d8d5ec6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
10 changes: 0 additions & 10 deletions src/gui/footer/footer_item_axis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ string_view_utf8 FooterItemAxisPos<AXIS>::static_makeViewIntoBuff(float value) {

if (printed_chars < 1) {
buff[0] = '\0';
} else if (size_t(printed_chars) < buff.size()) {
// Remove repeated trailing zeroes after the decimal point
while (((--printed_chars) > 2) && (buff[printed_chars] == '0') && (buff[printed_chars - 1] != '.')) {
buff[printed_chars] = '\0';
}
}
return string_view_utf8::MakeRAM((const uint8_t *)buff.data());
}
Expand Down Expand Up @@ -68,11 +63,6 @@ string_view_utf8 FooterItemAxisCurrPos<AXIS>::static_makeViewIntoBuff(float valu

if (printed_chars < 1) {
buff[0] = '\0';
} else if (size_t(printed_chars) < buff.size()) {
// Remove repeated trailing zeroes after the decimal point
while (((--printed_chars) > 2) && (buff[printed_chars] == '0') && (buff[printed_chars - 1] != '.')) {
buff[printed_chars] = '\0';
}
}
return string_view_utf8::MakeRAM((const uint8_t *)buff.data());
}
Expand Down
5 changes: 0 additions & 5 deletions src/gui/footer/footer_item_live_z.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ string_view_utf8 FooterItemLiveZ::static_makeView(int value) {

if (printed_chars < 1) {
buff[0] = '\0';
} else if (size_t(printed_chars) < buff.size()) {
// dont want it to erase last in 0.0, -1.0, -2.0
while ((--printed_chars) > 2 && buff[printed_chars] == '0' && buff[printed_chars - 1] != '.') {
buff[printed_chars] = '\0';
}
}

return string_view_utf8::MakeRAM((const uint8_t *)buff.data());
Expand Down

0 comments on commit d8d5ec6

Please sign in to comment.