Skip to Content
0

Change thousand separator, decimal separator at runtime

Jul 27, 2017 at 11:58 AM

32

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Ian Waterman Jul 27, 2017 at 12:42 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded