Loose Precision when retrieve data from rest web service


I use a rest service from jasper studio.
My data is for example : "5.65" (In JSON format)
When i click on Data preview , it show only '5'.  (The field is BigDecimal)

In my web service, if i change the mysql query with

 REPLACE (myValue, '.',',') // Replace dot by comma

The JSON become : '5,65' and it works ...

How can i cast this value in Jasper to avoid the use of replace...


jeff_33's picture
Joined: Jun 19 2018 - 9:16am
Last seen: 3 weeks 2 days ago

1 Answer:

It's use locale,
dependent method of org.apache.commons.beanutils for the conversion, namely LocaleConvertUtilsBean.convert(String, Class<?>, Locale, String).
look at :

[#14026] - Bug at converting BigDecimal numbers

sebj's picture
Joined: Oct 3 2022 - 6:45am
Last seen: 1 week 3 days ago