Class NumericParser
- Namespace
- MRX.Parsing.Reflection
- Assembly
- MRX.Parsing.Reflection.dll
Default INumericParser implementation that parses tokens via reflection over types implementing INumber<TSelf>.
public class NumericParser : INumericParser
- Inheritance
-
NumericParser
- Implements
- Inherited Members
Methods
Parse(Type, string, IFormatProvider?)
Parses token into a value of numericType.
public object Parse(Type numericType, string token, IFormatProvider? provider = null)
Parameters
numericTypeTypeThe numeric type to parse the token into. Must implement INumber<TSelf>.
tokenstringThe string representation of the value to parse.
providerIFormatProviderAn optional format provider used to interpret
token.
Returns
Exceptions
- ArgumentNullException
numericTypeortokenis null.- InvalidOperationException
numericTypedoes not implement INumber<TSelf>.