[Q] Percent and colors

Search This thread

error404

Senior Member
Jan 27, 2011
630
1,106
error404android.tumblr.com
OnePlus 8T
I have two questions (hope you guys can help me):

1 - Is there a way to hide some numbers? Here's what i want:
$((#usedSD#/#totalSD#)*100)$ = this will give me a percentage of used space in SD card, but i don't want the decimal numbers (23,33 - want to remove the numbers after the comma).

2 - How to apply different colors to a text?
#Battery# < 20 red color
#Battery# < 60 green color
#Battery# > 60 blue color

Sorry for my english and thank you in advance.
 

kwerdenker

Senior Member
Apr 1, 2010
1,451
2,533
Probably the Zooper Forums
I have two questions (hope you guys can help me):

1 - Is there a way to hide some numbers? Here's what i want:
$((#usedSD#/#totalSD#)*100)$ = this will give me a percentage of used space in SD card, but i don't want the decimal numbers (23,33 - want to remove the numbers after the comma).

2 - How to apply different colors to a text?
#Battery# < 20 red color
#Battery# < 60 green color
#Battery# > 60 blue color

Sorry for my english and thank you in advance.

1. You can use floor() to round numbers to their nearest lower integer or ceil() for the upper variant. Your code should look like this $(floor((#usedSD#/#totalSD#)*100))$
You can find all the available math functions for Zooper here: http://zooper.themerapp.com/support/solutions/articles/157988-math-expressions

2. Advanced Parameters are your friend here. The following code put into the Advanced Parameters of a text module will change the color according to your specifications:
Code:
$#BLEVN#<20?[c]ffff0000[/c]$$#BLEVN#>=20 && #BLEVN#<60?[c]ff00ff00[/c]$$#BLEVN#>=60?[c]ff0000ff[/c]$
 

geeket

Member
Nov 10, 2013
9
0
2. Advanced Parameters are your friend here. The following code put into the Advanced Parameters of a text module will change the color according to your specifications:
Code:
$#BLEVN#<20?[c]ffff0000[/c]$$#BLEVN#>=20 && #BLEVN#<60?[c]ff00ff00[/c]$$#BLEVN#>=60?[c]ff0000ff[/c]$

After put this code I have only this text "ff0000ff" - I do not have battery level....what is wrong ?
 

kwerdenker

Senior Member
Apr 1, 2010
1,451
2,533
Probably the Zooper Forums
After put this code I have only this text "ff0000ff" - I do not have battery level....what is wrong ?
You probably put the code into the text field instead in the Advanced Parameters field. Scroll down to the end of the module options when editing your text module, there you'll find it.

Send from my secret moonbase via space carrier pigeons
 
  • Like
Reactions: teteu86

geeket

Member
Nov 10, 2013
9
0
You probably put the code into the text field instead in the Advanced Parameters field. Scroll down to the end of the module options when editing your text module, there you'll find it.

Send from my secret moonbase via space carrier pigeons

OK - I have this but...all should look like this:

+add "text" -> in "edit text" write #BLEV# -> in advaced Parameters write Your code :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    I have two questions (hope you guys can help me):

    1 - Is there a way to hide some numbers? Here's what i want:
    $((#usedSD#/#totalSD#)*100)$ = this will give me a percentage of used space in SD card, but i don't want the decimal numbers (23,33 - want to remove the numbers after the comma).

    2 - How to apply different colors to a text?
    #Battery# < 20 red color
    #Battery# < 60 green color
    #Battery# > 60 blue color

    Sorry for my english and thank you in advance.

    1. You can use floor() to round numbers to their nearest lower integer or ceil() for the upper variant. Your code should look like this $(floor((#usedSD#/#totalSD#)*100))$
    You can find all the available math functions for Zooper here: http://zooper.themerapp.com/support/solutions/articles/157988-math-expressions

    2. Advanced Parameters are your friend here. The following code put into the Advanced Parameters of a text module will change the color according to your specifications:
    Code:
    $#BLEVN#<20?[c]ffff0000[/c]$$#BLEVN#>=20 && #BLEVN#<60?[c]ff00ff00[/c]$$#BLEVN#>=60?[c]ff0000ff[/c]$
    1
    After put this code I have only this text "ff0000ff" - I do not have battery level....what is wrong ?
    You probably put the code into the text field instead in the Advanced Parameters field. Scroll down to the end of the module options when editing your text module, there you'll find it.

    Send from my secret moonbase via space carrier pigeons