Skip to content

Commit

Permalink
Merge pull request #2063 from MichaelDvP/dev
Browse files Browse the repository at this point in the history
fix rendering "-0.x" values (reported on discord)
  • Loading branch information
proddy authored Sep 28, 2024
2 parents 554425b + 77768f9 commit f096c1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ char * Helpers::render_value(char * result, const double value, const int8_t for
double v = value < 0 ? value - 1.0 / (2 * p[format]) : value + 1.0 / (2 * p[format]);
auto whole = (int32_t)v;

if (whole == 0 && v < 0) {
result[0] = '-';
result++;
}
itoa(whole, result, 10);

while (*result != '\0') {
Expand Down

0 comments on commit f096c1b

Please sign in to comment.