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
The primitive Format from stdlib's package "format" should allow for formatting with thousands separators, e.g. "10,000,000" instead of "10000000".
Note
Of course the thousands separator should be language dependent (and I just learned that even the grouping is language/culture dependent) but i18n seems not supported yet by Pony. I assume that currently the package "format" uses "." as decimal separator and therefore could use "," as grouping separator with a grouping of 3 digits for now (thousands separator). To allow more freedom the thousands separator to be used could be provided instead.
Proposal
The basic function Format.apply() could by extended with a new parameter separator (or maybe sep as Pony APIs seem to prefer abbreviated variable names):
"""...* sep. The character to be used as thousands separator."""funapply(
str: String,
fmt: FormatDefault = FormatDefault,
prefix: PrefixDefault = PrefixDefault,
prec: USize = -1,
width: USize = 0,
align: Align = AlignLeft,
fill: U32 = ' ',
sep: (U32 | None) = None)
: Stringiso^
The text was updated successfully, but these errors were encountered:
The primitive Format from stdlib's package "format" should allow for formatting with thousands separators, e.g. "10,000,000" instead of "10000000".
Note
Of course the thousands separator should be language dependent (and I just learned that even the grouping is language/culture dependent) but i18n seems not supported yet by Pony. I assume that currently the package "format" uses "." as decimal separator and therefore could use "," as grouping separator with a grouping of 3 digits for now (thousands separator). To allow more freedom the thousands separator to be used could be provided instead.
Proposal
The basic function Format.apply() could by extended with a new parameter
separator
(or maybesep
as Pony APIs seem to prefer abbreviated variable names):The text was updated successfully, but these errors were encountered: