We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e6e6916 commit fbbbe85Copy full SHA for fbbbe85
1 file changed
src/runtime/json/number.cc
@@ -48,11 +48,11 @@ namespace ssc::runtime::JSON {
48
// trim trailing zeros
49
if (decimal >= 0) {
50
auto i = output.size() - 1;
51
- while (output[i] == '0' && i >= decimal) {
+ while ((output[i] == '0' || output[i] == '.') && i >= decimal) {
52
i--;
53
}
54
55
- return output.substr(0, i);
+ return output.substr(0, i + 1);
56
57
58
return output;
0 commit comments