Skip to main content Skip to complementary content

Money# - script and chart function

Money#() converts a text string to a money value, in the format set in the load script or the operating system, unless a format string is supplied. Custom decimal and thousand separator symbols are optional parameters.

Syntax:  

Money#(text[, format[, dec_sep [, thou_sep ] ] ])

Return data type: dual

Arguments
Argument Description
text The text string to be evaluated.
format String describing the expected input format to use when converting the string to a numeric interval.

If omitted, the money format set in the operating system is used.

dec_sep

String specifying the decimal number separator. If omitted, the MoneyDecimalSep value set in the data load script is used.

thou_sep

String specifying the thousands number separator. If omitted, the MoneyThousandSep value set in the data load script is used.

The Money# function generally behaves like the Num# function but takes its default values for the decimal and thousand separators from the script variables for money format or the system settings for currency.

Example: Chart expressions
Example Results
Money#('35 648,37 kr' , '# ##0,00 kr',',',' ' )

Returns 35 648,37 kr when the MoneyFormat setting is # ##0,00 kr. The following need to be set in your load script for this to evaluate correctly as a number:

  • SET MoneyDecimalSep=',';

  • SET MoneyThousandSep=' ';

Money#( '$35,648.37', ' $#', '.', ',' )

Returns $35,648.37 when the following is set: 

  • MoneyFormat is $#

  • SET MoneyDecimalSep=',';

  • SET MoneyThousandSep=' ';

Example - Money# fundamentals

Example - Money# scenario

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!