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