Page 1 of 1

Number Format Error

Posted: 29 Jan 2015 16:15
by TraianC
Hello,
I want to display programmaticaly a number from a variable in a text field of a widget.
The number should be displayed with only 2 digits.
I don't want to use global variables.

So, I use this:

setWidgetElementProperty("UWidget", "Text1", "text", {totalTrafic,numberformat,0.00});

I'm getting an error that a ; is missing.

What am I doing wrong?

Regards,
TC

Re: Number Format Error

Posted: 29 Jan 2015 22:25
by TheBrain1984
try

setWidgetElementProperty("UWidget", "Text1", "text", "{totalTrafic,numberformat,0.00}");

Because you are using {} in a "code-element", that doesn't work. You can use {} as a kind of code declaration in a text-element so you need " .

Re: Number Format Error

Posted: 30 Jan 2015 08:40
by TraianC
It worked. Thank you!