Project: Birt
Bug 155138 Complete support of Decimal data type in BIRT
Reported: 2006-08-24 19:13:08 | Status: resolved fixed

Data type Decimal (which maps to java.math.BigDecimal) support in BIRT engine/data engine is incomplete. Currently decimal values are converted to Double before any calculation and formatting. This behavior is incorrect since it loses the arbitury-precision aspect of the Decimal data type (which is really what Decimal type is designed for). The proper handling of Decimal type will require that expressions involving Decimal values be calculated outside of the Rhino engine (since Rhino does not handle Decimal types).

Files changed in fix:
core/org.eclipse.birt.core/src/org/eclipse/birt/core/script/MathUtil.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/calculator/BigDecimalCalculator.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/calculator/BooleanCalculator.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/calculator/CalculatorFactory.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/calculator/DateCalculator.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/calculator/ICalculator.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/calculator/NumberCalculator.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/calculator/StringCalculator.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/Finance.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/RunningAccumulator.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/SummaryAccumulator.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalAve.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalCount.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalCountDistinct.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalFirst.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalIrr.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalLast.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalMax.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalMedian.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalMin.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalMirr.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalMode.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalMovingAve.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalNpv.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalRunningCount.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalRunningNpv.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalRunningSum.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalStdDev.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalSum.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalVariance.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/TotalWeightedAve.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/rank/BaseTopBottomAccumulator.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/rank/PercentileAccumulator.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/rank/TotalIsBottomNPercent.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/rank/TotalIsTopN.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/rank/TotalIsTopNPercent.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/rank/TotalPercentRank.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/rank/TotalPercentSum.java data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/rank/TotalRank.java data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/aggregation/TotalTest.java data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/script/ScriptEvalUtil.java