DecimalFormat getNegativeSuffix() method in Java
Last Updated :
01 Apr, 2019
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:
import java.text.DecimalFormat;
public class GFG {
public static void main(String[] args)
{
DecimalFormat deciFormat = new DecimalFormat();
deciFormat.setNegativeSuffix( "negative" );
String negativeSuffix = deciFormat.getNegativeSuffix();
System.out.println(negativeSuffix);
}
}
|
Reference: https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html#getNegativeSuffix()
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...