44
55public static class NumbersToWords
66{
7- private static string ConvertWholeNumber ( int number , NumberWordsVocabulary numberWordsVocabulary )
8- {
9- return number switch
7+ private static string ConvertWholeNumber ( int number , NumberWordsVocabulary numberWordsVocabulary ) =>
8+ number switch
109 {
1110 < 20 => numberWordsVocabulary . NumbersZeroToNineteen [ number ] ,
1211 < 100 => Tens ( number , numberWordsVocabulary ) ,
@@ -15,7 +14,6 @@ private static string ConvertWholeNumber(int number, NumberWordsVocabulary numbe
1514 < 100000 => TensOfThousands ( number , numberWordsVocabulary ) ,
1615 _ => "Числото е твърде голямо"
1716 } ;
18- }
1917
2018 private static string Tens ( int n , NumberWordsVocabulary numberWordsVocabulary )
2119 {
@@ -122,15 +120,9 @@ private static string TensOfThousands(int number, NumberWordsVocabulary numberWo
122120 return BuildThousandsWithoutAnd ( Tens ( i , numberWordsVocabulary ) , Hundreds ( e , numberWordsVocabulary ) ) ;
123121 }
124122
125- private static string BuildThousandsWithoutAnd ( string thousands , string afterThousands )
126- {
127- return thousands + " хиляди " + afterThousands ;
128- }
123+ private static string BuildThousandsWithoutAnd ( string thousands , string afterThousands ) => thousands + " хиляди " + afterThousands ;
129124
130- private static string BuildThousandsWithAnd ( string thousands , string afterThousands )
131- {
132- return thousands + " хиляди и " + afterThousands ;
133- }
125+ private static string BuildThousandsWithAnd ( string thousands , string afterThousands ) => thousands + " хиляди и " + afterThousands ;
134126
135127 public static string Convert ( decimal number , CurrencyDescriptor currencyDescriptor )
136128 {
0 commit comments