Skip to content

Commit

Permalink
core: snexpr - compile time options for formatting fload with full pr…
Browse files Browse the repository at this point in the history
…ecission
  • Loading branch information
miconda committed Sep 30, 2022
1 parent d5df2e4 commit ff7913f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/utils/snexpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,11 @@ static int snexpr_format_num(char **out, float value)
return -1;
}
if(value - (long)value != 0) {
#ifdef SNEXPR_FLOAT_FULLPREC
ret = snprintf(*out, 24, "%g", value);
#else
ret = snprintf(*out, 24, "%.4g", value);
#endif
} else {
ret = snprintf(*out, 24, "%lld", (long long)value);
}
Expand Down

0 comments on commit ff7913f

Please sign in to comment.