numerals
v0.1.3
Published
Convert numbers to standard numeral forms.
Downloads
592
Maintainers
Readme
Numerals
Convert numbers to their form in a numeral system.
Currently only implements the roman numerals system converter.
See also: https://en.wikipedia.org/wiki/List_of_numeral_systems
How-to?
- Install the package
npm i numerals
- Use the package
import { Language, NumeralForm, convertNumberToNumeralForm } from 'numerals';
let x = convertNumberToNumeralForm(8, NumeralForm.Roman, Language.English);
// Outputs VIII
console.log(x);
- Get the web component
wget https://neig.es/numerals/script/numerals-ui.js
- Use the web component
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Numerals converter</title>
</head>
<body>
<numerals-ui></numerals-ui>
<script src="./script/numerals-ui.js"></script>
</body>
</html>