DecimalAdjustOptions
Specifies options for adjusting a decimal number, specifing min/max fractions, rounding, etc.
object { round?, minimumIntegerDigits?, maximumFractionDigits?, minimumFractionDigits?, maximumSignificantDigits?, minimumSignificantDigits? }
Properties
round?: RoundingModeType
- Mode used to round numbers during formatting.
minimumIntegerDigits?: number
- Minimum integer digits to display.
maximumFractionDigits?: number
- Maximum fraction digits to display.
minimumFractionDigits?: number
- Minimum fraction digits to display.
maximumSignificantDigits?: number
- Maximum significant digits to display.
minimumSignificantDigits?: number
- Minimum significant digits to display.
Defaults
{
round: 'half-even',
minimumIntegerDigits: 1,
minimumFractionDigits: 0,
maximumFractionDigits: 0,
}
Examples
const cldr = framework.get('en');
log(cldr.Numbers.adjustDecimal('1.5', { maximumFractionDigits: 0 }));
log(cldr.Numbers.adjustDecimal('1.5', { maximumFractionDigits: 0, round: 'down' }));
2 1