Skip to content

Commit

Permalink
[CORE] Fix incorrect precision of Decimal literal
Browse files Browse the repository at this point in the history
  • Loading branch information
蒋添 authored and jiangjiangtian committed Aug 21, 2024
1 parent 371d448 commit e32c494
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ object DecimalArithmeticUtil {
// For decimal * 10 case, dec will be Decimal(38, 18), then the result precision is wrong,
// so here we will get the real precision and scale of the literal.
private def getNewPrecisionScale(dec: Decimal): (Integer, Integer) = {
val input = dec.abs.toString()
val input = dec.abs.toJavaBigDecimal.toPlainString()
val dotIndex = input.indexOf(".")
if (dotIndex == -1) {
return (input.length, 0)
Expand Down

0 comments on commit e32c494

Please sign in to comment.