numerals

Convert numbers to standard numeral forms.

Usage no npm install needed!

<script type="module">
  import numerals from 'https://cdn.skypack.dev/numerals';
</script>

README

Node.js CI codecov

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

Try the converter!

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>