open-source-parsers / open-source-parsers/jsoncpp
the right zeros would be preserved, not be trimed
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.9k
- Forks
- 2.7k
- Avg merge
- 31m
- Merged PRs (30d)
- 1
Description
Describe the bug
In this test case, why is the expected value is 0.233 instead of 0.2330000000 whenthe precision is 10 ?
b.settings_["precision"] = 10;
b.settings_["precisionType"] = "decimal";
v = 0.23300000;
expected = "0.233";
In our project, if the precision is 10, we expect the output is 0.2330000000,but this behavior is not supported
To Reproduce
easy
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no source files or tests; start by reproducing the provided decimal-precision case and locate the code handling the decimal setting. Done means precision 10 preserves trailing zeros, producing 0.2330000000, with a regression test covering this behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100