Skip to content

Commit

Permalink
feat(@formatjs/intl): TS to 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
longlho committed Aug 30, 2020
1 parent d77b58d commit a334a8f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/intl/src/number.ts
Expand Up @@ -85,7 +85,9 @@ export function formatNumberToParts(
options: Parameters<IntlFormatters['formatNumber']>[1] = {}
): Intl.NumberFormatPart[] {
try {
return getFormatter(config, getNumberFormat, options).formatToParts(value);
return getFormatter(config, getNumberFormat, options).formatToParts(
value as number
);
} catch (e) {
config.onError(
new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting number.', e)
Expand Down

0 comments on commit a334a8f

Please sign in to comment.