You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'd like to be able to control what is the default format when no option is passed to format.*.
In particular, the default number formatting options in my app are { maximumFractionDigits: 2 } and I find myself having to use a specific option string with every use of format.number (e.g. format.number(n, "default")).
I am dealing with a lot of financial data in my app and the original defaults for most locales seem to keep (maximum) three decimal digits, which doesn't make sense in my app.
Describe the solution you'd like
I wish I could pass my global defaults in my config:
and have format.number(n) use these default formats.
Describe alternatives you've considered
The two main alternatives I have considered are:
use a custom global format and always call with an option string like format.number(n, "default") (note that this choice of option string both makes sense and is silly as one can argue default is when no option is provided)
but then you have one of the formatter that doesn't use the format.* function, leading to potential inconsistencies (or you can wrap every formatter and just always import your wrappers).
I know the alternatives are not too bad, yet I find none of them very satisfying.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'd like to be able to control what is the default format when no option is passed to
format.*
.In particular, the default number formatting options in my app are
{ maximumFractionDigits: 2 }
and I find myself having to use a specific option string with every use offormat.number
(e.g.format.number(n, "default")
).I am dealing with a lot of financial data in my app and the original defaults for most locales seem to keep (maximum) three decimal digits, which doesn't make sense in my app.
Describe the solution you'd like
I wish I could pass my global defaults in my config:
and have
format.number(n)
use these default formats.Describe alternatives you've considered
The two main alternatives I have considered are:
format.number(n, "default")
(note that this choice of option string both makes sense and is silly as one can argue default is when no option is provided)but then you have one of the formatter that doesn't use the
format.*
function, leading to potential inconsistencies (or you can wrap every formatter and just always import your wrappers).I know the alternatives are not too bad, yet I find none of them very satisfying.
The text was updated successfully, but these errors were encountered: