Table of Contents

Method TryParse

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

TryParse(string, out Decimal128)

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

public static bool TryParse(string s, out Decimal128 result)

Parameters

s string

The string representation of the number to convert.

result Decimal128

When this method returns, contains the Decimal128 number that is equivalent to the numeric value contained in s, if the conversion succeeded, or is zero if the conversion failed. The conversion fails if the s parameter is null, is not a number in a valid format, or represents a number less than the min value or greater than the max value. This parameter is passed uninitialized.

Returns

bool

true if s was converted successfully; otherwise, false.