DecimalFormat SetParseBigDecimal() Example
Sets whether the parse method returns BigDecimal
DecimalFormatclass SetParseBigDecimal() method example. This example shows you how to use SetParseBigDecimal() method.This method Sets whether the parse method returns BigDecimal
Here is the code:-
/**
* @Program that Sets whether the parse method returns BigDecimal
* SetParseBigDecimal.java
* Author:-RoseIndia Team
* Date:-13-Jun-2008
*/
import java.text.*;
public class SetParseBigDecimal {
public static void main(String[] args) {
// Creates a DecimalFormat object
DecimalFormat d = new DecimalFormat("36.538");
//Returns whether the parse method returns BigDecimal
System.out.println("IsParseBigDecimal : "+d.isParseBigDecimal());
//Sets the parse returns BigDecimal
d.setParseBigDecimal(true);
System.out.println("IsParseBigDecimal : "+d.isParseBigDecimal());
}
} |
Output of the Program
IsParseBigDecimal : false
IsParseBigDecimal : true
|
|