MoneyTryParse(String, ICurrency, Money) Method

Converts the String representation of a number to its Money equivalent. A return value indicates whether the conversion succeeded or failed.

Definition

Namespace: InnerDrive.Financial
Assembly: InnerDrive.Financial (in InnerDrive.Financial.dll) Version: 5.2.9017.0
C#
public static bool TryParse(
	string? s,
	ICurrency? currency,
	out Money? result
)

Parameters

s  String
A String object containing a number to convert.
currency  ICurrency
The units of currency to use when parsing s and returning result.
result  Money
When this method returns, contains a Money equivalent to the numeric value or symbol contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is a null reference, is not a number in a valid format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized.

Return Value

Boolean
true if s was converted successfully; otherwise; false.

Remarks

Important: This implementation assumes the result is denominated in U.S. dollars.

See Also