Stank1964
Well Known Member
Hi Guys.
So, when I am working with a currency value, like unit price with groovy, what's the correct groovy data type that I should be using? I have tried number, float, double, BigDecimal, all of those seem to not preserve the correct currency value or they flat out truncate the currency value for insignificant digits, like "70.00" can become 70 or 70.0 or 70.xxxxxxxxxxxxxxxxxxxxxxx99999, where all those "x"'s and "9" are other values - the point is that none of these data types will take 70.00 and yeild a value of 70.00.
Any ideas? Thanks!
So, when I am working with a currency value, like unit price with groovy, what's the correct groovy data type that I should be using? I have tried number, float, double, BigDecimal, all of those seem to not preserve the correct currency value or they flat out truncate the currency value for insignificant digits, like "70.00" can become 70 or 70.0 or 70.xxxxxxxxxxxxxxxxxxxxxxx99999, where all those "x"'s and "9" are other values - the point is that none of these data types will take 70.00 and yeild a value of 70.00.
Any ideas? Thanks!