ItEr45S04ValidacionEProbasFuncionaisItEr44S05: Fixing bug establishing rounding mode when setting scale to a BigDecimal.

This commit is contained in:
Javier Moran Rua 2010-01-27 17:17:17 +01:00
parent aea2112a1f
commit a69dfcf257

View file

@ -526,10 +526,10 @@ public abstract class ChartFiller implements IChartFiller {
Integer days = Days.daysBetween(firstDay, lastDay).getDays();
if (days > 0) {
BigDecimal ammount = lastValue.subtract(firstValue);
BigDecimal ammountPerDay = ammount.setScale(2).divide(
BigDecimal ammountPerDay = ammount.setScale(2, RoundingMode.DOWN).divide(
new BigDecimal(days), RoundingMode.DOWN);
BigDecimal value = firstValue.setScale(2);
BigDecimal value = firstValue.setScale(2, RoundingMode.DOWN);
for (LocalDate day = firstDay; day.compareTo(lastDay) <= 0; day = day
.plusDays(1)) {
map.put(day, value);