detecting radix characters in numbers as digit group separators when they are present more than once (e.g., 1.234.567 => 1234567 and 1.234.567,89 => 1234567.89).
choosing the last radix character that is present once as the radix point (e.g., 1,234.567 => 1234.567 and 1.234,567 => 1234.567).
The changes respect the radix character and detection settings so that:
("Detect All Radix Characters" is set)
1.234 => 1.234
1,234 => 1.234
1.123,567 => 1123.567
1,123.567 => 1123.567
1.123.567 => 1123567
1,123,567 => 1123567
("Detect All Radix Characters" is not set, "Radix Character" is set to ".")
1.234 => 1.234
1,234 => 1234
1.123,567 => 1.123567
1,123.567 => 1123.567
1.123.567 => 1123567 (maybe this should just fail?)
1,123,567 => 1123567
("Detect All Radix Characters" is not set, "Radix Character" is set to ",")
1.234 => 1234
1,234 => 1.234
1.123,567 => 1123.567
1,123.567 => 1.123567
1.123.567 => 1123567
1,123,567 => 1123567 (maybe this should just fail?)
I've also made the number parsing more generic so that we won't have to duplicate code for each base now.
This PR should fix #434 by:
detecting radix characters in numbers as digit group separators when they are present more than once (e.g.,
1.234.567
=>1234567
and1.234.567,89
=>1234567.89
).choosing the last radix character that is present once as the radix point (e.g.,
1,234.567
=>1234.567
and1.234,567
=>1234.567
).The changes respect the radix character and detection settings so that:
("Detect All Radix Characters" is set) 1.234 => 1.234 1,234 => 1.234 1.123,567 => 1123.567 1,123.567 => 1123.567 1.123.567 => 1123567 1,123,567 => 1123567 ("Detect All Radix Characters" is not set, "Radix Character" is set to ".") 1.234 => 1.234 1,234 => 1234 1.123,567 => 1.123567 1,123.567 => 1123.567 1.123.567 => 1123567 (maybe this should just fail?) 1,123,567 => 1123567 ("Detect All Radix Characters" is not set, "Radix Character" is set to ",") 1.234 => 1234 1,234 => 1.234 1.123,567 => 1123.567 1,123.567 => 1.123567 1.123.567 => 1123567 1,123,567 => 1123567 (maybe this should just fail?)
I've also made the number parsing more generic so that we won't have to duplicate code for each base now.