The Magnitude array simply holds the name of the thousand, million, billion... values. If you have the value 12,325,324,255 you can pass the values in a loop,
first 12 with magnitude 3 (billion)
second 325 with mag of 2 (million)
third 324, mag 1 (thousand)
forth 255 mag 0 (empty value)
The definition could be:
WaltCode:char *magnitude[] = {"", // empty for 0-999 "thousand", "million", "billion", ... };