Online Java Compiler By
JavaTpoint.com
import java.math.BigDecimal; public class BigDecimalFloatValueExample3 { public static void main(String[] args) { // Create BigDecimal object BigDecimal bdValue; // Create a float variable float floatValue; // Assigning Value into BigDecimal object bdValue = new BigDecimal("1632662.127655"); // It will return a float value floatValue = bdValue.floatValue(); //Displaying float value System.out.println("Returned float value is : "+floatValue); } }
Output