Java Format - Java DecimalFormat .getNegativePrefix ()








Syntax

DecimalFormat.getNegativePrefix() has the following syntax.

public String getNegativePrefix()

Example

In the following code shows how to use DecimalFormat.getNegativePrefix() method.

import java.text.DecimalFormat;
//from w w w .  j av a  2 s . c o m
public class Main {
  public static void main(String[] argv) throws Exception {
    DecimalFormat format = new DecimalFormat();
    
    System.out.println(format.getNegativePrefix());

  }
}

The code above generates the following result.