numeral-prefix

Library to generate greek-derived numeral prefixes from a plain number

Usage no npm install needed!

<script type="module">
  import numeralPrefix from 'https://cdn.skypack.dev/numeral-prefix';
</script>

README

Numeral Prefix

NPM Build status Maintainability status Coverage status Bundle size Code style: XO Release: Semantic

A function to generate greek-derived numeral prefixes from a plain number.

Install

npm install numeral-prefix

Usage

const numeralPrefix = require('numeral-prefix');

console.log(numeralPrefix(5, 'gon'));
// => pentagon

console.log(numeralPrefix(12, 'gon'));
// => dodecagon

console.log(numeralPrefix(2048, 'gon'));
// => dischiliatetracontakaioctagon

numeralPrefix(number[, suffix])

Generates a greek-derived numeral prefix based on the given number and appends the suffix.

number

Type: Number

Number to generate the prefix from.

suffix

Type: String
Default: ''

Suffix to append to the generated numeral prefix.

Contributing

Contributions are always welcome! Please run npm test beforehand to ensure everything is ok.

Support

If you use this package please consider starring it :)