summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-01 02:38:34 +0200
committerWuzzy <almikes@aol.com>2016-08-01 02:38:34 +0200
commit2156f463f4d3273b386f6aca72179c79b241fde6 (patch)
tree91a23dc183b2d61755df279788cec2827e154ed1
parent2b1c2ea45e978ab98589fef6d1c7686811af8f28 (diff)
Add circa word for prob.-based drops
-rw-r--r--init.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index fc6a4c7..ae32417 100644
--- a/init.lua
+++ b/init.lua
@@ -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