While Returning BigDecimal value in API response (JSON), we loose precision value from the BigDecimal
Actual Result we got from API response in JSON
Expected Result from JSON output (API Response from Kotlin Rest)
While Returning BigDecimal value in API response (JSON), we loose precision value from the BigDecimal
Actual Result we got from API response in JSON
Expected Result from JSON output (API Response from Kotlin Rest)
(Assuming you use ‘.’ to separate every three digits and ‘,’ for the decimal point)
Well you might have lost a few digits but you didn’t lose any significant figures.
You won’t lose precision like this with Json. It’s just a matter of string formatting in your case.
You have not specified how do you write and read values from Json. There are a lot of ways do so. And there are different ways to treat separators.