Value.formatNumber

Overview | Methods | This Package | All Packages

Value.formatNumber

Formats a numeric value using number formatting.

Syntax

public static String formatNumber( double value )

public static String formatNumber( double value, int decimalPlaces )

public static String formatNumber( double value, int decimalPlaces, int options )

Parameters

value

The value to format.

decimalPlaces

The number of decimal places in the resulting string or -1 for the default number of decimal places.

options

A combination of zero or more flags from the NumberFormat enumeration.

Return Value

Returns a string containing the formatted value.

Remarks

The resulting string is formatted according to the currency format settings of the current locale. Use the formatting options to selectively enable or disable the leading digit on values less than 1, the parentheses around negative numbers, and the use of the thousands separators.