31
Ah, there may not be a class to do this, but there was a code golf question which I provided a C# example for:
However, it's not the easiest to read and it only goes up to decimal.MaxValue, so I've written a new version that will go as high as you need to.
I couldn't find any information regarding values higher than vigintillions, but if you append the values to the thou[] array, you can continue going up as far as you like. It still doesn't support fractions, but I'm thinking about adding that at some point.
static string NumericStringToWords(string NumericValue)
{
if ("0" == NumericValue) return "zero";
string[] units = { "one", "two", "three", "four", "five",
"six", "seven", "eight", "nine" };
string[] teens = { "eleven", "twelve", "thirteen", "four", "fifteen",
"sixteen", "seventeen", "eighteen", "nineteen" };
string[] tens = { "ten", "twenty", "thirty", "forty", "fifty",
"sixty", "seventy", "eighty", "ninety" };
string[] thou = { "thousand", "million", "billion", "trillion",
"quadrillion", "quintillion", "sextillion",
"septillion", "octillion", "nonillion", "decillion",
"udecillion", "duodecillion", "tredecillion",
"quattuordecillion", "quindecillion", "sexdecillion",
"septendecillion", "octodecillion", "novemdecillion",
"vigintillion" };
string sign = String.Empty;
if ("-" == NumericValue.Substring(0, 1))
{
sign = "minus ";
NumericValue = NumericValue.Substring(1);
}
int maxLen = thou.Length * 3;
int actLen = NumericValue.Length;