Java tutorial
import java.math.BigDecimal; public class Main { public static void main(String[] args) { BigDecimal bg1 = new BigDecimal("100.123"); BigDecimal bg2 = new BigDecimal("50.56"); // subtract bg1 with bg2 and assign result to bg3 BigDecimal bg3 = bg1.subtract(bg2); String str = "The Result of Subtraction is " + bg3; // print bg3 value System.out.println(str); } }