Detect the radix point automatically when multiple choices are possible

Merged
#76 · Created  · Last updated

Merged pull request

Merged in number_parser (pull request #76)

f349947·Author: ·Closed by: ·2016-05-28

Description

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 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.

0 attachments

0 comments

Loading commits...