Open In App

DecimalFormat getNegativeSuffix() method in Java

Last Updated : 01 Apr, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
The getNegativeSuffix() method of the DecimalFormat class in Java is used to get the negative suffix value of this DecimalFormat instance. Syntax:
public String getNegativeSuffix()
Parameters: This method does not accepts any parameter. Return Value: This method returns negative suffix value of this DecimalFormat instance. Below program illustrate the above method: Java
// Java program to illustrate the
// getNegativeSuffix() method

import java.text.DecimalFormat;

public class GFG {

    public static void main(String[] args)
    {

        // Create a DecimalFormat instance
        DecimalFormat deciFormat = new DecimalFormat();

        // Set a negative suffix
        deciFormat.setNegativeSuffix("negative");

        // Get the negative suffix value
        String negativeSuffix = deciFormat.getNegativeSuffix();

        System.out.println(negativeSuffix);
    }
}
Output:
negative
Reference: https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html#getNegativeSuffix()

Similar Reads