Skip to content

Commit

Permalink
feat(i18n): optional number args
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd committed Feb 15, 2023
1 parent 91d1594 commit b571385
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/i18n/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ export function message(key?: string | null): string | undefined {
/**
* Format number to active locale string unicode and digital group.
*/
export const number = (number: number): string => {
export const number = (number?: number | null): string => {
if (number == null) return loadingStr;
if (activeNumberFormatter === null) return String(number);
return activeNumberFormatter.format(number);
};
Expand Down

0 comments on commit b571385

Please sign in to comment.