public static string ConvertToLiteral(int number, CurrencyGenere genere = CurrencyGenere.Male, CurrencyLanguage spanish = CurrencyLanguage.Spanish) { switch (LengthNumber(number)) { case 1: return Units(number, genere); case 2: return Tens(number, genere); case 3: return Hundreds(number, genere); case 4: return MillerUnits(number, genere); case 5: return MillerTens(number, genere); case 6: return MillerHundreds(number, genere); case 7: return MillionUnits(number, genere); case 8: return MillonTens(number, genere); case 9: return MillonHundreds(number, genere); default: return "Numero demasiado grande."; break; } }
private static string Units(int number, CurrencyGenere genere = CurrencyGenere.Male, CurrencyLanguage spanish = CurrencyLanguage.Spanish) { switch (number) { case 0: return ""; case 1: return (genere == CurrencyGenere.Male) ? "uno" : "una"; case 2: return "dos"; case 3: return "tres"; case 4: return "cuatro"; case 5: return "cinco"; case 6: return "seis"; case 7: return "siete"; case 8: return "ocho"; case 9: return "nueve"; } return "Error"; }