Skip to content
Permalink
Browse files

2000 is written as MM

  • Loading branch information
michaelbannister committed Jul 3, 2016
1 parent 6f87581 commit 0d7e4fa7a1244a26e44f92b791b2d0a20d37c4c5
Showing with 3 additions and 2 deletions.
  1. +1 −1 src/main/kotlin/RomanNumerals.kt
  2. +2 −1 src/test/kotlin/DecimalToRomanConverterTest.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) {
@@ -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.
You can’t perform that action at this time.