-
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:
Code:
char *magnitude[] = {"", // empty for 0-999
"thousand",
"million",
"billion",
...
};
Walt
-
Just a thought - you may need to do a locale check, as in many countries (such as the UK until a few years ago) a billion is a million million, not a thousand million (aka a 'toy' billion).