BigDecimal.toEngineeringString() has the following syntax.
public String toEngineeringString()
In the following code shows how to use BigDecimal.toEngineeringString() method.
/* w w w . ja v a2 s . c o m*/ import java.math.BigDecimal; public class Main { public static void main(String[] args) { BigDecimal bg = new BigDecimal("1E+4"); System.out.println("Engineering string value of " + bg + " is " + bg.toEngineeringString()); } }
The code above generates the following result.