Skip to content

Commit

Permalink
fix: Pass formatter to pluralization function (#1294)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-korolev authored Nov 7, 2022
1 parent 5e43810 commit 33af3ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const defaultFormats = (
return (ctx) => {
const msg = isFunction(message) ? message(ctx) : message
const norm = Array.isArray(msg) ? msg : [msg]
const valueStr = number(locales)(value)
const numberFormat = Object.keys(formats).length ? style('number') : {};
const valueStr = number(locales, numberFormat)(value)
return norm.map((m) => (isString(m) ? m.replace("#", valueStr) : m))
}
}
Expand Down

0 comments on commit 33af3ba

Please sign in to comment.