DecimalFormat getNegativePrefix() method in Java
Last Updated :
01 Apr, 2019
The getNegativePrefix() method of the DecimalFormat class in Java is used to get the negative prefix value of this DecimalFormat instance.
Syntax:
public String getNegativePrefix()
Parameters: This method does not accepts any parameter.
Return Value: This method returns negative prefix value of this DecimalFormat instance.
Below program illustrate the above method:
import java.text.DecimalFormat;
public class GFG {
public static void main(String[] args)
{
DecimalFormat deciFormat = new DecimalFormat();
String negativePrefix = deciFormat.getNegativePrefix();
System.out.println(negativePrefix);
}
}
|
Reference: https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html#getNegativePrefix()
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...