Skip to content

Commit

Permalink
2000 is written as MM
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbannister committed Jul 3, 2016
1 parent 6f87581 commit 0d7e4fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/RomanNumerals.kt
@@ -1,6 +1,6 @@
fun Int.toRoman(): String {
if (this >= 1000) {
return "M"
return "M".repeat(this / 1000)
} else if (this >= 100) {
return "C".repeat(this / 100)
} else if (this >= 10) {
Expand Down
3 changes: 2 additions & 1 deletion src/test/kotlin/DecimalToRomanConverterTest.kt
Expand Up @@ -23,7 +23,8 @@ class DecimalToRomanConverterTest {
arrayOf(20, "XX"),
arrayOf(100, "C"),
arrayOf(200, "CC"),
arrayOf(1000, "M")
arrayOf(1000, "M"),
arrayOf(2000, "MM")
)
}

0 comments on commit 0d7e4fa

Please sign in to comment.