Storeing Individual Digits from a Int Variable...

So, after hours of mathing I made this event work the way I wanted... it stores the indiviual digits of a number in four variables. My intentions for this are to get the individual stats of the players characters to display on a custom status screen.... just cuz. As I stated, the event seems to be working as intended, but my mind isint well suited to programing and I was wondering if anyone knew a better way to go about this? Thank you for any advice 🙂 !

1594328120157.png
I copied the Eventcode from RMMV as Text, one possible way to make it could look like this:
Code:
◆Control Variables:#0061..0064 = HP of Harold
◆Comment:Ones
◆Control Variables:#0061 var61 %= 10
◆Comment:---------------------------------------
◆Control Variables:#0062 var62 %= 100
◆Control Variables:#0063 var63 %= 1000
◆Control Variables:#0064 var64 %= 10000
◆Comment:Thousands
◆Control Variables:#0064 var64 -= var63
◆Control Variables:#0064 var64 /= 1000
◆Comment:Hundrets
◆Control Variables:#0063 var63 -= var62
◆Control Variables:#0063 var63 /= 100
◆Comment:Tens
◆Control Variables:#0062 var62 -= var61
◆Control Variables:#0062 var62 /= 10
1594387982178.png


I did it a similar way to Bex.

1594388007250.png


(using MV but the principle for the setup is the same)

Original thread: https://forums.rpgmakerweb.com/threads/storeing-individual-digits-from-a-int-variable.123858/