I have to mimic RPG behavior in Java. In RPG, there are 2 zoned decimal fields FLDA is length 2 with 0 decimals FLDB is length 5 with 1 decimals FLDA value = 0 FLDB value = 1234.5
RPG line of code
C Z-ADDFLDB FLDA
FLDA value would then be 34. By default RPG does not throw an overflow exception, it truncates to fit.
How can I do this with Java BigDecimal?