Investment Studio > Expressions > Functions > Text > DOLLAR

string dollar(float amount, integer digits = 2)

Returns a string representation of the amount using the system-defined currency format (see the Currency panel in the Windows Control Panel's Regional Settings applet) rounded to the specified number of digits.

If digits >= 0, amount is rounded to digits decimal places.

If digits < 0, amount is rounded digits places left of the decimal point.

If digits is omitted, it defaults to 2.

Examples

Assuming default US currency format settings,

=dollar(7654.321, 2)

equals "$7,654.32"

=dollar(7654.321, -2)

equals "$7,700"

=dollar(-7654.321, -2)

equals "($7,700)"

=dollar(-0.765, 4)

equals "($0.7650)"

=dollar(67.788)

equals "$67.79".

See also fixed, round, value.