ItEr45S04ValidacionEProbasFuncionaisItEr44S05: Fixing bug establishing rounding mode when setting scale to a BigDecimal.
This commit is contained in:
parent
aea2112a1f
commit
a69dfcf257
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue