-
-
Notifications
You must be signed in to change notification settings - Fork 243
Description
Implement new option DigitSeparator with four values:
- DigitSeparatorUnderscore (default)
- DigitSeparatorComma
- DigitSeparatorApostrophe
- DigitSeparatorNone
When DigitSeparatorUnderscore is used, integers and floats should be formatted with thousand separators like this:
1_000_000
3.141_592_653
DigitSeparatorComma and DigitSeparatorApostrophe are similar, but use ,
and '
as separator, instead of _
. DigitSeparatorNone corresponds to current behavior when no separator is used.
All numbers are formatted using DefaultFormatter.formatValue, so DigitSeparator should be handled there. It already has branches for float32 and float64; now we'll need to add branch for integers (we can use refIsNum function).
For an example of similar option and its handling, see DefaultFormatter.FloatFormat.
New option should have documentation. Formatter tests should be updated.
https://en.wikipedia.org/wiki/Decimal_separator
https://en.wikipedia.org/wiki/Integer_literal