Strength int to bar conversion

Michele Renda michele.renda at
Mon Jan 5 15:31:21 CET 2009

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
             bar = 0

But I am not sure if the values I choose were good. There is a standard?

Thank you all.
Michele Renda

More information about the community mailing list