liquid_feedback_frontend
changeset 104:a9ea02807b94
voting result also with percent values
author | jorges |
---|---|
date | Mon Sep 20 01:43:19 2010 +0200 (2010-09-20) |
parents | 7d0f4721d2f3 |
children | 07953b0ef62c |
files | app/main/initiative/_show.lua |
line diff
1.1 --- a/app/main/initiative/_show.lua Mon Sep 20 01:18:03 2010 +0200 1.2 +++ b/app/main/initiative/_show.lua Mon Sep 20 01:43:19 2010 +0200 1.3 @@ -12,11 +12,12 @@ 1.4 slot.put(" ") 1.5 local positive_votes = initiative.positive_votes 1.6 local negative_votes = initiative.negative_votes 1.7 - slot.put(_"Yes" .. ": <b>" .. tostring(positive_votes) .. "</b>") 1.8 + local sum_votes = initiative.positive_votes + initiative.negative_votes 1.9 + slot.put(_"Yes" .. ": <b>" .. tostring(positive_votes) .. " (" .. string.format("%.f", positive_votes * 100 / sum_votes ) .. "%)" .. "</b>") 1.10 slot.put(" · ") 1.11 slot.put(_"Abstention" .. ": <b>" .. tostring(max_value - initiative.negative_votes - initiative.positive_votes) .. "</b>") 1.12 slot.put(" · ") 1.13 - slot.put(_"No" .. ": <b>" .. tostring(initiative.negative_votes) .. "</b>") 1.14 + slot.put(_"No" .. ": <b>" .. tostring(initiative.negative_votes) .. " (" .. string.format( "%.f", negative_votes * 100 / sum_votes ) .. "%)" .. "</b>") 1.15 slot.put(" · ") 1.16 slot.put("<b>") 1.17 if initiative.rank == 1 then