DecimalFormat

Methods
12
Fields
None

Getting one

NumberFormat.getInstance()
NumberFormat.getNumberInstance()
NumberFormat.getIntegerInstance()

Methods

MethodReturnsDescription
applyPattern(string)()Replace the pattern.
setRoundingMode(RoundingMode)()The rounding mode.
getRoundingMode()RoundingModeThe rounding mode.
setGroupingSize(number)()The digits per group.
getGroupingSize()numberThe digits per group.
setDecimalSeparatorAlwaysShown(boolean)()Whether a whole number still shows the decimal separator.
setMultiplier(number)()The multiplier (100 for percent).
setPositivePrefix(string)()The positive prefix.
setPositiveSuffix(string)()The positive suffix.
setNegativePrefix(string)()The negative prefix.
setNegativeSuffix(string)()The negative suffix.
new()DecimalFormat() -> DecimalFormat: #,##0.###.
new(string)DecimalFormat

Returned by

MethodReturnsDescription
DecimalFormatClass.newDecimalFormat() -> DecimalFormat: #,##0.###.
NumberFormatClass.getInstanceDecimalFormat#,##0.### in the default locale.
NumberFormatClass.getIntegerInstanceDecimalFormat#,##0 rounding HALF_EVEN, parsing integers only.
NumberFormatClass.getNumberInstanceDecimalFormat#,##0.### in the default locale.
NumberFormatClass.getPercentInstanceDecimalFormat#,##0%.

Method details

new

new: (() -> DecimalFormat) & ((string) -> DecimalFormat)

() -> DecimalFormat: #,##0.###.

(string) -> DecimalFormat: A format for pattern; an invalid pattern is IllegalArgumentException.