Online Java Compiler By
JavaTpoint.com
import java.math.BigDecimal; public class BigDecimalFloatValueExample4 { 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("-165662.1276"); // It will return a float value floatValue = bdValue.floatValue(); //Displaying float value System.out.println("Returned float value is : "+floatValue); } }
Output