Method TryParseMoney
TryParseMoney(ReadOnlySpan<char>, MonetaryStyles, IFormatProvider?, out MonetaryValue)
Converts the string representation of a monetary value to its MonetaryValue equivalent using this currency registry.
Declaration
public bool TryParseMoney(ReadOnlySpan<char> s, MonetaryStyles style, IFormatProvider? provider, out MonetaryValue result)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<char> | s | The string representation of the monetary value to convert. |
MonetaryStyles | style | A combination of MonetaryStyles values that indicate the styles that can be parsed. |
IFormatProvider | provider | A format provider that supplies culture-specific parsing information. |
MonetaryValue | result | The parsed monetary value if parsing was successful; otherwise a default monetary value. |
Returns
Type | Description |
---|---|
bool |
TryParseMoney(ReadOnlySpan<char>, MonetaryStyles, IFormatProvider?, out MonetaryValue, out string)
Converts the string representation of a monetary value to its MonetaryValue equivalent using this currency registry.
Declaration
public bool TryParseMoney(ReadOnlySpan<char> s, MonetaryStyles style, IFormatProvider? provider, out MonetaryValue result, out string error)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<char> | s | The string representation of the monetary value to convert. |
MonetaryStyles | style | A combination of MonetaryStyles values that indicate the styles that can be parsed. |
IFormatProvider | provider | A format provider that supplies culture-specific parsing information. |
MonetaryValue | result | The parsed monetary value if parsing was successful; otherwise a default monetary value. |
string | error | An error message if parsing failed; otherwise an empty string. |
Returns
Type | Description |
---|---|
bool |