List of usage examples for java.math BigDecimal plus
public BigDecimal plus(MathContext mc)
From source file:Main.java
public static void main(String[] args) { BigDecimal bg1 = new BigDecimal("-333.3454"); MathContext mc = new MathContext(4); // 4 precision // perform plus on bg1 using mc BigDecimal bg2 = bg1.plus(mc); System.out.println(bg2);//from w w w . j a v a 2s . c o m }