Skip to content

Fix "loss of data ..." error in Decimal

Latest
Compare
Choose a tag to compare
@josecelano josecelano released this 17 Apr 16:44
· 1 commit to master since this release

Using default precision for Decimal (28) we get an error is the string represents a number with higher precision.

Error: Loss of data on string conversion in ... on line 1

So we need to truncate the string before instantiating the Decimal object.