Project

General

Profile

Support #5199

decimal - get value

Added by Marian Edu over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

History

#1 Updated by Marian Edu over 5 years ago

Trying to get the JSON serialization as close as possible to the 4GL one I see for decimal data type the conversion is using a BigDecimal but it does that by messing with numeric locales and string representation while the decimal object already have the BigDecimal value right there... it's just not possible to access it, for whatever reason the getValue method returns the double value hence lost of precision is most likely to occur.

Is there a reason for this, the method doesn't seem to be used anywhere so would it be possible to just change that to return the actual BigDecimal value instead?

#2 Updated by Constantin Asofiei over 5 years ago

There is the decimal.toBigDecimal() if you want to get the BigDecimal instance.

#3 Updated by Marian Edu over 5 years ago

Constantin Asofiei wrote:

There is the decimal.toBigDecimal() if you want to get the BigDecimal instance.

Thanks a bunch, for whatever reason was only looking at getter methods :(

#4 Updated by Greg Shah over 5 years ago

  • % Done changed from 0 to 100
  • Assignee set to Constantin Asofiei
  • Status changed from New to Closed

Also available in: Atom PDF