Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Commit

Permalink
fix russian Kotlin-Polytech#2
Browse files Browse the repository at this point in the history
  • Loading branch information
vladdenisov committed Mar 3, 2022
1 parent db1d94b commit 2bb9f17
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/lesson4/task1/List.kt
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,15 @@ fun russian(n: Int): String {
triadResult += " две тысячи "
} else if (triad[1].digitToIntOrNull()!! in 5..9) {
triadResult += firstDecade[triad[1].digitToIntOrNull()!!] + " тысяч "
} else if (triad[1] == '0') {
triadResult += " тысяч "
} else {
triadResult += firstDecade[triad[1].digitToIntOrNull()!!] + " тысячи "
}
triadResult += when (triad[1]) {
'0' -> " тысяч "
'1' -> "одна тысяча "
'2' -> " две тысячи "
else -> firstDecade[triad[1].digitToIntOrNull()!!] + " тысячи "

}
}
} else {
if (triad[1] == '0' && triad[2] == '0') {
triadResult += hundreds[triad[0].digitToIntOrNull()!!] + " тысяч "
Expand Down

0 comments on commit 2bb9f17

Please sign in to comment.