Skip to Content

Change thousand separator, decimal separator at runtime

Hi folks,

I need to change the decimal and thousands separator depending on a condition. If the invoiceCurrency is EUR then use euro format; anything else use standard format.

I have tried:

if {usp_Invoice1.invoiceCurrency} = "EUR" THEN

ToText ({usp_Invoice1.price}, "##.##0,00", 2)

else

ToText ({usp_Invoice1.price}, "###,##0.00", 2)

This allows me to save the report. But when I run the program, I get 'Invalid number format' error message.

Any ideas ???

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jul 27, 2017 at 12:42 PM

    Can the invoice price be null. If yes go to File-> Report options and check set Null to default value.

    Of if you prefer test for null

    if {usp_Invoice1.invoiceCurrency} = "EUR" THEN

    If isnull({usp_Invoice1.invoiceCurrency}) then '0,00' else

    ToText ({usp_Invoice1.price}, "##.##0,00", 2)

    Finally make sure {usp_Invoice1.invoiceCurrency} is a number.

    Ian

    Add comment
    10|10000 characters needed characters exceeded