diff options
author | Wuzzy <almikes@aol.com> | 2016-08-01 02:38:34 +0200 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-08-01 02:38:34 +0200 |
commit | 2156f463f4d3273b386f6aca72179c79b241fde6 (patch) | |
tree | 91a23dc183b2d61755df279788cec2827e154ed1 | |
parent | 2b1c2ea45e978ab98589fef6d1c7686811af8f28 (diff) |
Add circa word for prob.-based drops
-rw-r--r-- | init.lua | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -344,7 +344,14 @@ doc.new_category("nodes", { rarity = 1 end end - formstring = formstring .. string.format(" (%.0f%%)",((1/rarity)*100)) + local chance = (1/rarity)*100 + -- Add circa indicator for percentages with decimal point + local ca = "" + -- FIXME: Does this actually reliable? + if math.fmod(chance, 1) > 0 then + ca = "ca. " + end + formstring = formstring .. string.format(" (%s%.0f%%)", ca, chance) if max ~= nil then remaining_rarity = 1/(1/remaining_rarity - 1/rarity) end |