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