### Calculating the ratio... (to Javascript experts)

Posted:

**February 2nd 2014, 7:48pm**There are 2 Divs: #Thanks_given li and #Thanks_received li.

But i want make this one; Thanks ratio (between the Thanks received and the Thanks given), with img bar and Css.

for example:

User:

Thanks given: 6000

Thanks received: 720

Thanks ratio: 0.2 (1200/6000=0.12) with img bar.

if the Thanks ratio= 0.12 the img bar= (full red bar) (Minimum ratio). with CSS.

if the Thanks ratio= 0.2 the img bar= IMG.

if the Thanks ratio= 0.3 the img bar= IMG.

if the Thanks ratio= 0.4 the img bar= IMG.

if the Thanks ratio= 0.5 the img bar= IMG.

if the Thanks ratio= 0.6 the img bar= IMG.

if the Thanks ratio= 0.7 the img bar= IMG.

if the Thanks ratio= 0.8 the img bar= IMG.

if the Thanks ratio= 0.9 the img bar= IMG.

if the Thanks ratio= 1.0 (and more) the img bar= (full green bar).

But i want make this one; Thanks ratio (between the Thanks received and the Thanks given), with img bar and Css.

for example:

User:

Thanks given: 6000

Thanks received: 720

Thanks ratio: 0.2 (1200/6000=0.12) with img bar.

if the Thanks ratio= 0.12 the img bar= (full red bar) (Minimum ratio). with CSS.

if the Thanks ratio= 0.2 the img bar= IMG.

if the Thanks ratio= 0.3 the img bar= IMG.

if the Thanks ratio= 0.4 the img bar= IMG.

if the Thanks ratio= 0.5 the img bar= IMG.

if the Thanks ratio= 0.6 the img bar= IMG.

if the Thanks ratio= 0.7 the img bar= IMG.

if the Thanks ratio= 0.8 the img bar= IMG.

if the Thanks ratio= 0.9 the img bar= IMG.

if the Thanks ratio= 1.0 (and more) the img bar= (full green bar).