string String.TwoDigitWords(int num) { double_words = {"Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"}; teen_words = {"Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"}; single_words = {"One","Two","Three","Four","Five","Six","Seven","Eight","Nine"}; //num = 99; amount_in_words = ""; if(num > 0) { if(num < 10) { amount_in_words = single_words.get(num - 1); } else if(num < 20) { amount_in_words = teen_words.get(num - 10); } else if(num < 100) { first_digit_str = num.toString().substring(0,1); first_digit = first_digit_str.toLong(); if(num % 10 == 0) { amount_in_words = double_words.get(first_digit - 2); } else { second_digit_str = num.toString().substring(1); second_digit = second_digit_str.toLong(); amount_in_words = double_words.get(first_digit - 2) + " " + single_words.get(second_digit - 1); } } } return amount_in_words; }