Note this is not a duplicate, I'm and referring to rounding; not adding.
So I am dealing with BigDecimal and everything I do works as planned except for the rounding of certain numbers. It is easier to explain with code, but the rounding changes property between numbers. Note this is a always round down mode (truncating). It should round to 6 numbers in the decimal point.
System.out.println( (new BigDecimal(1.340)).round(new MathContext(7, RoundingMode.DOWN))); //returns 1.400000
System.out.println( (new BigDecimal(2.340)).round(new MathContext(7, RoundingMode.DOWN))); //returns 2.339999 …Run Code Online (Sandbox Code Playgroud)