Skip to content

dos_strformatcurrency

Dale Fugier edited this page Jul 1, 2026 · 1 revision

Formats a number as a currency string.

Currency string is formatted based on the currency settings identified in the Regional and Language Options found in Control Panel unless one of the overrides is specified.

Syntax

(dos_strformatcurrency number [num_digits [leading_zero [decimal_sep [thousands_sep [currency_sym]]]]])

Parameters

number

A number as a currency string.

num_digits

Number of fractional digits for the monetary format. Value must be number between 0 and 9.

leading_zero

Specifier for leading zeros in decimal fields. Value must be either 0 or 1.

decimal_sep

Character(s) used as the monetary decimal separator. Maximum number of characters is 4.

thousands_sep

Character(s) used as the monetary thousands separator. Maximum number of characters is 4.

currency_sym

String used as the monetary symbol. Maximum number of characters is 6.

Returns

The formatted currency string if successful.

nil on error.

Example

Command: (dos_strformatcurrency 1234.56)
"$1,234.56"

Command: (dos_strformatcurrency 1234.56 0)
"$1,235"

Command: (dos_strformatcurrency 0.56 2 0)
"$.56"

Clone this wiki locally