Split Numbers Into Digits

I am fairly certain this is possible, but how would I go about splitting a number (example HP) into individual digits and loading them into a variable? 
A single variable can't hold multiple values. So 123 can't be split into 1, 2, and 3 and stored in $game_variables[1], unless you're using either a hash or an array.


Otherwise, this would split up the variables into digits:

Code:
def split_digits(num)
  digits = []
  num.to_s.each_char do |bit|
    digits.push(bit.to_i)
  end
  return digits
end

Calling split_digits(123) would return [1, 2, 3]. This is called an 'array'. If you then wanted to store it into variables, you'd do a script call and say


$game_variables[3], $game_variables[2], $game_variables[1] = split_digits(421)


And variable 3 would get 4, variable 2 would get 2, and variable 1 would get 1.


If instead you had called split_digits(53), variable 3 wouldn't get anything (it'd be empty) variable 2 would get 5, and variable 1 would get 3.
What are you trying to do?
@Tsukihime I am trying to show the player's level, MP and HP using pictures which I sort of know how to do, I just wanted to know how to split the digits of those numbers into separate variables so that I can reset one digit when switching to the next, example resetting the ones column when switching to the tens column. 

Original thread: https://forums.rpgmakerweb.com/threads/split-numbers-into-digits.66259/