Skip to content
Convert Arabic to Roman UTF-8 numerals
JavaScript HTML
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
dist
example
.editorconfig
.gitignore
.jscsrc
.jshintrc
.npmignore
.travis.yml
LICENSE
README.md
bower.json
index.js Polymorphisme #8
package.json
test.js

README.md

arabic-roman-convert.js

NPM version Build Status Coveralls Status Dependency Status DevDependency Status

Convert Arabic to Roman UTF-8 numerals

Demo: vovanr.github.io/arabic-roman-convert.js

Arabic numerals .arabicToRoman({Number|String})

1 → Ⅰ
2 → Ⅱ
3 → Ⅲ
4 → Ⅳ
5 → Ⅴ
6 → Ⅵ
7 → Ⅶ
8 → Ⅷ
9 → Ⅸ
10 → Ⅹ
11 → Ⅺ
12 → Ⅻ
15 → ⅩⅤ
25 → ⅩⅩⅤ
50 → Ⅼ
100 → Ⅽ
500 → Ⅾ
1000 → Ⅿ

Simple roman strings .convertRoman({String})

I → Ⅰ
III → Ⅲ
vii → Ⅶ
ix → Ⅸ
X → Ⅹ
XV → ⅩⅤ
l → Ⅼ
c → Ⅽ
D → Ⅾ
M → Ⅿ

Arabic number or simple Roman string .toRoman({String|Number})

2 → Ⅱ
III → Ⅲ
vii → Ⅶ
9 → Ⅸ
X → Ⅹ
XV → ⅩⅤ
l → Ⅼ
100 → Ⅽ
D → Ⅾ
M → Ⅿ

Install and Usage

Bower

bower install --save arabic-roman-convert.js
<link rel="stylesheet" href="bower_components/arabic-roman-convert.js/dist/arabic-roman-convert.min.js">
var num = window.ArabicRoman.toRoman(2015);
console.log(num); // ⅯⅯⅩⅤ

Node

npm i --save arabic-roman-convert.js
var arabicRomanConvert = require('arabic-roman-convert.js');

var num = arabicRomanConvert.toRoman(2015);
console.log(num); // ⅯⅯⅩⅤ

License

MIT © Vladimir Rodkin

Something went wrong with that request. Please try again.