summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/init.lua b/init.lua
index 51e6ca9..f235601 100644
--- a/init.lua
+++ b/init.lua
@@ -427,13 +427,18 @@ doc.new_category("nodes", {
end
end
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. "
+ if rarity > 200 then -- <0.5%
+ -- For very low percentages
+ formstring = formstring .. " (<0.5%)"
+ else
+ -- 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)
end
- formstring = formstring .. string.format(" (%s%.0f%%)", ca, chance)
if max ~= nil then
remaining_rarity = 1/(1/remaining_rarity - 1/rarity)
end