I am trying to print my number 12386876764.34 and I want my output as the same. I tried the following to print my number, but could not find a way to print the same. Please provide a solution for this.
public static void main(String[] args) {
System.out.println((12386876764.34*100)/100);
System.out.println(Math.round(12386876764.34*100)/100);
System.out.println((new BigDecimal((12386876764.34*100)/100)).toPlainString());
System.out.println((new BigDecimal(Math.round(12386876764.34*100)/100)).toPlainString());
}
Output: 1.238687676434E10 12386876764 12386876764.340000152587890625 12386876764