DecimalFormat SetPositiveSuffix() Example
Set the positive suffix.
DecimalFormatclass SetPositiveSuffix() method example. This example shows you how to use SetPositiveSuffix() method.This method Set the positive suffix.
Here is the code:-
/**
* @Program that Set the positive suffix.
* SetPositiveSuffix.java
* Author:-RoseIndia Team
* Date:-13-Jun-2008
*/
import java.text.*;
public class SetPositiveSuffix {
public static void main(String[] args) {
// Creates a DecimalFormat object
DecimalFormat d = new DecimalFormat("0.00+");
// Get the positive suffix.
String s=d.getPositiveSuffix();
System.out.println("The positive Suffix is: "+s);
d.setPositiveSuffix("*");
String s1=d.getPositiveSuffix();
System.out.println("The positive Suffix is: "+s1);
}
} |
Output of the Program
The positive Suffix is: +
The positive Suffix is: * |
|