Strength int to bar conversion

Rui Miguel Silva Seabra rms at 1407.org
Mon Jan 5 15:54:31 CET 2009


On Mon, Jan 05, 2009 at 03:31:21PM +0100, Michele Renda wrote:
> Hello to all...
> 
> Here for you another question:
> 
>  From fso-framework, I receive the signal strenght as a int 0 <= i <= 100.
> If I want to present this value as well know "vertical green bar" (4 
> bar) how according you is better to transform i to bar?
> 
> I am currently using this:
> 
>          if strength >=90:
>              bar = 4
>          elif strength >=80:
>              bar = 3
>          elif strength >=50:
>              bar = 2
>          elif strength >=10:
>              bar = 1
>          else:
>              bar = 0
> 
> But I am not sure if the values I choose were good. There is a standard?

If it's a 4 bar system, shouldn't you try to use values close to steps
of 25 ?

Rui

-- 
Or not.
Today is Setting Orange, the 5th day of Chaos in the YOLD 3175
Celebrate Mungday
+ No matter how much you do, you never do enough -- unknown
+ Whatever you do will be insignificant,
| but it is very important that you do it -- Gandhi
+ So let's do it...?




More information about the community mailing list