Table of contents
TOC
Collapse the table of content
Expand the table of content

Currency.From

Owen Duncan|Last Updated: 10/5/2018
|
1 Contributor

About

Returns a currency value from the given value.

Currency.From(value as any, optional culture as nullable text, optional roundingMode as nullable number) as nullable number  

Arguments

ArgumentDescription
valueValue to convert.
optional cultureA text value corresponding to the culture values supported on your version of Windows, such as "en-US". If the culture is not specified, the current user culture is used. For a list of culture names, see National Language Support (NLS) API Reference.
optional roundingModeSpecifies rounding direction when there is a tie between the possible numbers to round to.

Remarks

If a value is null, Currency.From returns null. If a value is a number within range of currency, the fractional part of the value is rounded to 4 decimal digits and returned. The valid range for currency is -922,337,203,685,477.5808 to 922,337,203,685,477.5807. If value is of any other type or out of the range, an error is returned. See Number.FromText for converting it to a number value, then convert from a number to a 64-bit integer. See Number.Round for the available rounding modes, the default is RoundingMode.ToEven.

Examples

Currency.From("1.23455") equals 1.2346  
Currency.From("1.23455", "en-Us", RoundingMode.Down) equals 1.2345  
© 2018 Microsoft