numeral-prefix

    1.0.0 • Public • Published

    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 :)

    Install

    npm i numeral-prefix

    DownloadsWeekly Downloads

    6

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    14.7 kB

    Total Files

    8

    Last publish

    Collaborators

    • avatar