Shared: Fixed bug in toRomanNumeral.
9 and numbers ending in 9 would end with "IXIV." Thanks to Jesse Rosenthal. Closes #1249.
This commit is contained in:
parent
d8d4ede4d6
commit
7f036c0b57
1 changed files with 2 additions and 2 deletions
|
@ -234,9 +234,9 @@ toRomanNumeral x =
|
|||
_ | x >= 50 -> "L" ++ toRomanNumeral (x - 50)
|
||||
_ | x >= 40 -> "XL" ++ toRomanNumeral (x - 40)
|
||||
_ | x >= 10 -> "X" ++ toRomanNumeral (x - 10)
|
||||
_ | x >= 9 -> "IX" ++ toRomanNumeral (x - 5)
|
||||
_ | x == 9 -> "IX"
|
||||
_ | x >= 5 -> "V" ++ toRomanNumeral (x - 5)
|
||||
_ | x >= 4 -> "IV" ++ toRomanNumeral (x - 4)
|
||||
_ | x == 4 -> "IV"
|
||||
_ | x >= 1 -> "I" ++ toRomanNumeral (x - 1)
|
||||
_ -> ""
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue