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