Skip to main content

Cloud Reports: Trying to use string.Format(FormatMoneyDecimal but FormatMoneyDecimal doesn't exist as a variable in the report - Knowledgebase / Cloud - Wasp Helpdesk

Cloud Reports: Trying to use string.Format(FormatMoneyDecimal but FormatMoneyDecimal doesn't exist as a variable in the report

Authors list

Some of the Cloud reports contain a variable called FormatMoneyDecimal, which allows you to format a monetary field (e.g. cost) using the monetary decimal place value in Cloud settings.

However, some reports do not have FormatMoneyDecimal, and if you try to use it, there is an error when you run the report: "The name 'FormatMonetaryDecimal' does not exist in the current context." Here's how to add it to the report in the Report Designer.

At bottom left, click Dictionary tab.
Expand out Variables, Do Not Touch.
Right-click Do Not Touch, then New Variable.

Name: FormatMoneyDecimal
tab key, Alias changes to FormatMoneyDecimal
Type: string, Value
Init by: Expression
Expression: "{0:N" + MonetaryDecimalPlaces +"}"

OK

upload.png

Helpful Unhelpful