NumberFormatErrorType
Syntax
'nan' | 'infinity'
Example
const cldr = framework.get('en');
log(cldr.Numbers.formatDecimal(NaN));
log(cldr.Numbers.formatDecimal(Infinity));
NaN ∞
const cldr = framework.get('en');
try {
cldr.Numbers.formatDecimal(NaN, { errors: ['nan'] });
} catch (e) {
log(e.toString());
}
try {
cldr.Numbers.formatDecimal(Infinity, { errors: ['infinity'] });
} catch (e) {
log(e.toString());
}
Error: Invalid argument: NaN Error: Invalid argument: Infinity