Number Format Error

Post your questions and help other users.

Moderator: Martin

Post Reply
TraianC
Posts: 66
Joined: 24 Oct 2014 13:29

Number Format Error

Post by TraianC » 29 Jan 2015 16:15

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

User avatar
TheBrain1984
Posts: 137
Joined: 07 Aug 2013 08:17
Location: Germany

Re: Number Format Error

Post by TheBrain1984 » 29 Jan 2015 22:25

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 " .

TraianC
Posts: 66
Joined: 24 Oct 2014 13:29

Re: Number Format Error

Post by TraianC » 30 Jan 2015 08:40

It worked. Thank you!

Post Reply