Shared: Fixed bug in toRomanNumeral.
9 and numbers ending in 9 would end with "IXIV."
Thanks to Jesse Rosenthal. Closes #1249.
commit7f036c0b57f2791c03040bed61e55adcd21ee496
authorJohn MacFarlane <fiddlosopher@gmail.com>
dateTue 15 Apr 2014, 19:53 (13 years ago)
parentd8d4ede
src/Text/Pandoc/Shared.hs+2−2
@@ -234,9 +234,9 @@ toRomanNumeral x =
234234 _ | x >= 50 -> "L" ++ toRomanNumeral (x - 50)
235235 _ | x >= 40 -> "XL" ++ toRomanNumeral (x - 40)
236236 _ | x >= 10 -> "X" ++ toRomanNumeral (x - 10)
237− _ | x >= 9 -> "IX" ++ toRomanNumeral (x - 5)
237+ _ | x == 9 -> "IX"
238238 _ | x >= 5 -> "V" ++ toRomanNumeral (x - 5)
239− _ | x >= 4 -> "IV" ++ toRomanNumeral (x - 4)
239+ _ | x == 4 -> "IV"
240240 _ | x >= 1 -> "I" ++ toRomanNumeral (x - 1)
241241 _ -> ""
242242