liquid_feedback_frontend

diff env/format/percent_floor.lua @ 1210:7e48d429389f

Unified rendering of vote percentages (floor instead of round)
author bsw
date Sat Jul 18 16:46:55 2015 +0200 (2015-07-18)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/env/format/percent_floor.lua	Sat Jul 18 16:46:55 2015 +0200
     1.3 @@ -0,0 +1,7 @@
     1.4 +function format.percent_floor(p, q)
     1.5 +  if q > 0 then
     1.6 +    return math.floor(100 * p / q) .. "%"
     1.7 +  else
     1.8 +    return "0%"
     1.9 +  end
    1.10 +end

Impressum / About Us