NumberParser Code >
Similarly to what happens with
also includes some extensions to the basic NumberX functionalities
(which already allow to account for non-natively-supported scenarios like
NumberP numberP = new NumberP("12345e6789");
). All the code dealing with its specific functionalities is stored in Constructors_NumberP.cs
and in the files inside the NumberP folder
inputs into numeric types, what explains its two additional
string variable displaying the input being parsed.
Config. Its underlying
ParseConfig defines the configuration of the given parsing process.
fields which are very descriptive of what
Target. A (numeric)
Type variable eventually (it might be left blank) defining the target format, as determined by the property below.
The ParseTypes enum lists the special parsing conditions supported by
- Parsing only to
Target. Inputs outside the range of the associated native type trigger an error.
For example, the input "123456" with
Target would be wrong. Bear in mind that the default
NumberP behaviour is to pass the overflowing information to
BaseTenExponent and, consequently, those inputs would output 123*10^3.
- Strictly parsing thousands separators. The .NET native
TryParse methods supporting thousands separators don't care about their positions (e.g.,
decimal.Parse("1,0,,00", CultureInfo.InvariantCulture) doesn't trigger any error), a curious reality which is addressed by this format.
NumberP supports blank spaces (100 000) and two further grouping approaches: Indian (10,00,000) and Chinese (100,0000).