Convert integers to words and roman numerals
Is there a library for converting integers to strings so that they (integers) are represented as words? For example:
21 => "twenty one"
I'm also interested in converting integers to strings that represent them as roman numerals:
21 => "XXI"
It's not hard for me to write conversion functions like this, but I don't want to reinvent the wheel.
+3
source to share
1 answer
Take a look at the cl format, it might return "twenty one", I used this for an euler project.
http://clojuredocs.org/clojure_core/1.2.0/clojure.pprint/cl-format
and Roman too:
~@R prints arg as a Roman numeral: IV; and ~:@R prints arg as an old Roman numeral: IIII.
+6
source to share