Enter space in a widget

Post your questions and help other users.

Moderator: Martin

Post Reply
Mar
Posts: 49
Joined: 20 May 2015 23:24
Location: Germany

Enter space in a widget

Post by Mar » 04 Dec 2015 14:25

In the moment I'm developing a flow which checks periodically amazon's prices of some products. I store these prices in a map variable with some additional information.

global_amazon={www.amazon.de/product 1[name1, price1, merchant1], www.amazon.de/product2=[name2, price2, merchant2]}

Moreover, I have got an overlay which shows me the actual price. The widget extracts the prices of all products and store them in a local list. (list=[14,36, 25,68]). That's no problem. But now I am not able to show the prices with a added euro symbol at the end in multiple lines. So my widget should like:

price1€
price2€
price3€

I tried to paste a enter space so that the prices are in different lines but it causes an error. Additionally, all prices should be shown centrally. Is there a way to solve this?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Enter space in a widget

Post by Martin » 04 Dec 2015 20:30

Hi,

You could use a script to concatenate the prices in a loop:

Code: Select all

list = newList(14, 36, 25, 68);
res = "";
for (p in list)
{
  res = res + p + "€\n";
}
setWidgetElementProperty("Widget1", "Text_1", "text", res);
The widget element has to be set to Multiline and Textalign to Center.

Regards,
Martin

Mar
Posts: 49
Joined: 20 May 2015 23:24
Location: Germany

Re: Enter space in a widget

Post by Mar » 05 Dec 2015 00:11

Thanks a lot, Martin!

Post Reply