Code loose space in Control Page

Posted on
Wed Sep 21, 2016 1:13 pm
zurich offline
Posts: 103
Joined: Aug 11, 2014

Code loose space in Control Page

Greetings,

I can't display spaces when make Control Page. This code:
Code: Select all
data2 = '     '.join(["hi:%s" %high, "lo:%s" %low, "PoP:%s" %PoP])

It show in Custom States with correct spacing (I try to paste the string from Custom States here to show you but it also loose the spacing)
but when I try to display in Control Page it come out as:
hi:11°C lo:5°C PoP:60%

Please why I am loose spacing?

Kind regards,

Z

Posted on
Thu Sep 22, 2016 1:28 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Code loose space in Control Page

Are you just loosing the leading spaces? Or something in the middle of the string?

I suspect the control page removes leading spaces. I think you would be better off using the placement controls in the control page editor to get what you want, rather than trying to pad the string.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Sep 22, 2016 2:57 pm
zurich offline
Posts: 103
Joined: Aug 11, 2014

Re: Code loose space in Control Page

Greetings:

I want this "hi:11°C lo:5°C PoP:60%" not this "hi:11°C lo:5°C PoP:60%". This is a single string. The string show with spaces in the Custom States, but in the Control Page it reverts back to no spaces.

kind regards,

Z

Posted on
Thu Sep 22, 2016 3:29 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Code loose space in Control Page

Try posting those strings using the Code tags. I can't see what you're trying to do.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Sep 25, 2016 2:57 pm
zurich offline
Posts: 103
Joined: Aug 11, 2014

Re: Code loose space in Control Page

Greetings,

I want to have 4 or 5 spaces between the hi:value, low:value and PoP:value.

I want this:

hi:11°C [space] lo:5°C [space] PoP:60%


this code for some reason removes the space in the control page:
Code: Select all
data2 = '     '.join(["hi:%s" %high, "lo:%s" %low, "PoP:%s" %PoP])


kind regards,

Z

Posted on
Mon Sep 26, 2016 3:05 pm
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Code loose space in Control Page

Are you viewing in a browser or in Indigo Touch?

I'd recommend just putting each individual element on the control page (hi, low, PoP) rather than trying to shove them into a single string. That would give you a lot more flexibility in layout...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 15 guests