The previousDouble() method of java.text.ChoiceFormat class is used to get the double value just lesser than the passed double value.
public static final double previousDouble(double d)
Parameter: This method accepts double value d as a parameter for which the previous double value is returned.
Return Value: This method returns an double value just lesser than the passed double value.
Below are the examples to illustrate the previousDouble() method:
Lesser double value: 21.999999999999996
Just lesser than 1.23: 1.2299999999999998 Just lesser than 10.0: 9.999999999999998 Just lesser than -12.0: -12.000000000000002 Just lesser than 1.2000000476837158: 1.2000000476837156 Just lesser than 50.0: 49.99999999999999
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.