You probably don’t really need to understand it, but those *set four lines will basically convert any excess bronze coins (over 99) into silvers, and excess silvers into gold.
The other lines are just variable definitions and a quick display, for example purposes.
In that example it’ll turn:
Gold: 1
Silver: 1523
Bronze: 112
into
Gold: 16
Silver: 24
Bronze: 12
Copy and paste all that into here, if you want to see it working.
You basically just slap those four lines in anytime you want to sort ‘top-heavy’ currencies.