DecimalSeparatorRewriter constructor
Implementation
DecimalSeparatorRewriter(NumberFormat format)
: _decimalSeparator = format.symbols.DECIMAL_SEP,
_separatorToReplace = _findSeparatorToReplace(format) {
// Here we check that there are no group separators.
// The formatted string should
// * contain the nine digits 1..9
// * contain one decimal separator (either ',' or '.')
// * have a length of 10 (9 digits and one separator)
const double number = 1234567.89;
const String formattedDot = '1234567.89';
const String formattedComma = '1234567,89';
final String formatted = format.format(number);
assert(
formatted == formattedDot || formatted == formattedComma,
'Wrong format: $formatted found, either $formattedDot or $formattedComma expected',
);
}