How do I make an SI unit 'if 10,100,1000...'dec,hec,kilo..' etc. list, in blocks of 1000? I'm trying to add labels to my encumbrance/max lifting lists, but they get exponentially larger, so creatures like dragons and giant robots can move tons, or even kilotons of stuff (useful if you are doing a 'transport' game with things like 'ship capacity' and get paid by the weight of the cargo).
So basically I want to do kiltons, megatons, gigatons, and so on, but I don't want a huge list of if then else, and i don't know how to make something similar to it with case. My goal is to take up very little space.
label = @actor.enc > 1000 ? "tons" : "kg"
div_max = @actor.enc > 1000 ? @actor.enc/1000 : @actor.enc