Online Java Compiler By
JavaTpoint.com
import java.math.BigDecimal; public class BigDecimalDoubleValueExample3 { public static void main(String[] args) { // Create BigDecimal object BigDecimal bdValue; // Create double type variable double dValue; bdValue = new BigDecimal("-1120"); // It will return double type value dValue = bdValue.doubleValue(); // Displaying double value System.out.println("BigDecimal "+bdValue+" value converted in to double is = " +dValue); } }
Output