Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matthieubosquet/numerals
Numerals conversion
https://github.com/matthieubosquet/numerals
numerals roman
Last synced: about 2 months ago
JSON representation
Numerals conversion
- Host: GitHub
- URL: https://github.com/matthieubosquet/numerals
- Owner: matthieubosquet
- License: mit
- Created: 2020-06-25T23:19:15.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T09:53:48.000Z (almost 2 years ago)
- Last Synced: 2024-11-01T13:47:19.811Z (2 months ago)
- Topics: numerals, roman
- Language: TypeScript
- Homepage: https://neig.es/numerals/
- Size: 434 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Node.js CI](https://github.com/matthieubosquet/numerals/workflows/Node.js%20CI/badge.svg?branch=master)
[![codecov](https://codecov.io/gh/matthieubosquet/numerals/branch/master/graph/badge.svg)](https://codecov.io/gh/matthieubosquet/numerals)# Numerals
Convert numbers to their form in a numeral system.
Currently only implements the [roman numerals system](https://en.wikipedia.org/wiki/Roman_numerals) converter.
See also: [https://en.wikipedia.org/wiki/List_of_numeral_systems](https://en.wikipedia.org/wiki/List_of_numeral_systems)
[Try the converter!](https://neig.es/numerals/)
## How-to?
- Install the package
```bash
npm i numerals
```- Use the package as an ECMAScript module
```javascript
import { convertNumberToNumeralForm, Language, NumeralForm } from 'numerals';let x = convertNumberToNumeralForm(8, NumeralForm.Roman, Language.English);
// Outputs VIII
console.log(x);
```- Use the package as a CommonJS module
```javascript
const { convertNumberToNumeralForm, Language, NumeralForm } = require('numerals')let x = convertNumberToNumeralForm(8, NumeralForm.Roman, Language.English)
// Outputs VIII
console.log(x);
```- Get the web component
```bash
wget https://neig.es/numerals/script/numerals-ui.js
```- Use the web component
```html
Numerals converter
```