BigDecimal specific refactoring
Use BigDecimal.stripTrailingZeros() as key for getVATPercentMap and in consequence use compareTo... == 0 instead of equals Use BigDecimal.ZERO instead of new BigDecimal(0) These changes result in improvements in enumeration of the <ram:SpecifiedTradeAllowanceCharge> tags and the calculation of tag <ram:SpecifiedTradeSettlementHeaderMonetarySummation>.
This commit is contained in:
@@ -52,7 +52,7 @@ public class BaseTest extends TestCase {
|
||||
}
|
||||
|
||||
public void testCorrectDigits() {
|
||||
assertEquals("0.00", XMLTools.nDigitFormat(new BigDecimal(0),2));
|
||||
assertEquals("0.00", XMLTools.nDigitFormat(BigDecimal.ZERO,2));
|
||||
assertEquals("-1.10", XMLTools.nDigitFormat(new BigDecimal("-1.10"),2));
|
||||
assertEquals("-1.10", XMLTools.nDigitFormat(new BigDecimal("-1.1"),2));
|
||||
assertEquals("-1.01", XMLTools.nDigitFormat(new BigDecimal("-1.01"),2));
|
||||
|
||||
Reference in New Issue
Block a user