Module talk:Coins
Clickable coins
[edit source]It would be nice that if the value represented a GE value, that you would be able to click the amount to go to the Exchange:<item> page
For instance
{{Coins|{{GEP|Ranarr seed}}}}
would then become:
84.81.222.13 14:13, August 25, 2018 (UTC)
- Not saying I care for the idea, but to do this I believe you'd have to modify GEPrice not Coins/GEP. GEP is not the same as GEPrice and is meant for calculations, adding that functionality could potentially break calculations made with GEP templates. I'm certainly no expert though, especially when it comes to modules. iN008talk 14:22, August 25, 2018 (UTC)
- I created an alternative that people can use:
- [[Template:GECoins]]
- Coolcat007 (talk) 15:00, August 25, 2018 (UTC)
Found a bug
[edit source]Discovered this while I was looking at user sandboxes with creepy crawlers init. And I can't fix it since the page is protected.
If you feed the Coins template an expression that divides by zero, this module throws an error, where it should instead detect the condition and return zero.
You can verify this by typing the following into the debug console:
= p._amount('8191/0')
--The scribe
10:48, 8 September 2020 (UTC)
- I think throwing an error is desired here, actually. Division by zero is undefined, and if you made it return 0 it'd be much harder to debug potential issues. The burden of "be careful when dividing" should rest on the person calling the template, not the template itself. -Towelcat (talk) 12:45, 8 September 2020 (UTC)
Formatting is often too precise
[edit source]This module (and associated template) has no way to specify precision on its output. It just has a simple rule that if it detects [./] then it rounds to two decimal places. This has ended up with the wiki often showing way too much precision on calculations than is justified. Examples:
- Money_making_guide/Killing_The_Doom_of_Mokhaiotl_(Delve_1-8), table at the bottom has 10 significant figures.
- Money_making_guide/Chambers_of_Xeric_(Challenge_Mode), table at the bottom has 9 significant figures.
- Archers_ring_(i) creation table has one figure derived from a calculation but the other is just raw GEP lookup, leading to the smaller number appearing visually larger. This occurs often on Template:Recipe transcludes involving shop points.
While the 2 decimal places is obviously useful in e.g. GP/XP tables, for larger numbers this almost always results in absurd precision. The main workaround I'm aware of is wrapping the given expr in an #expr first, but I don't think this is sufficient. In many cases this is not an option, e.g. when using Template:Recipe. And many people simply don't know this is the "correct" workaround, e.g. in that CoX money making page an editor tried to workaround this using a floor() in the expr, which only made things worse (precision still there, but now there's .00 at end of every figure).
My suggestion is twofold:
- Change default behaviour when [./] is detected to round to 5 significant figures, with at most 2 decimal places. (Not possible with a simple string.format call, but I can provide a method that will do this formatting.) This will in many cases round larger numbers a lot more than they are presently, but I think this is warranted in more cases than not anyway.
- Provide parameter to template/function to override this, e.g. {{Coins|...|precision=3}} to get more or less significant figures.
Now, this might be overcomplicating things, and just changing "if has_decimal_or_division then" to "if has_decimal_or_division and math.abs(a) < 1000 then" would fix most glaring issues. But the level of precision on a lot of figures output by this module does seem to contradict how Monkey making guide rounds every listed rate to the nearest 1000, which is why I suggest going a bit further in changing the default behaviour. 6weetbix (talk) 04:44, 10 February 2026 (UTC)