Online Java Compiler By
JavaTpoint.com
import java.math.BigDecimal; public class BigDecimalIntValueExactExample3 { public static void main(String[] args) { // Creating BigDecimal Objects BigDecimal bdValue; //Create int variable int integerValue; // Assigning value into BigDecimal object bdValue = new BigDecimal("55384629.32290"); //it returns integer value integerValue=bdValue.intValueExact(); // Displaying exact Integer Value System.out.println("Returned Exact Integer Value of " +bdValue + " is = " + integerValue); } }
Output