hnhdigital-os/php-number-converter

Number to word, roman, ordinal converter

1.2.0 2021-02-27 03:13 UTC

This package is auto-updated.

Last update: 2024-11-29 03:54:34 UTC


README

This package provides the ability to convert a numerical number to a word, roman numeral, or include the ordinal suffix.

Latest Stable Version Total Downloads Latest Unstable Version License

Build Status StyleCI Test Coverage Issue Count Code Climate

This package has been forked from saintkabyo/number-converter and further developed by H&H|Digital, an Australian botique developer. Visit us at hnh.digital.

Install

Via composer:

$ composer require hnhdigital-os/php-number-converter

Usage

Convert to word

Supported number range -2147483647 to 2147483647.

use HnhDigital/PhpNumberConverter;

echo (new NumberConverter())->word(1);
one

Convert to roman

Supported number range 1 to 3999.

use HnhDigital/PhpNumberConverter;

echo (new NumberConverter())->roman(1);
I

Ordinal (word + suffix)

Supported number range 1 to 2147483647.

use HnhDigital/PhpNumberConverter;

echo (new NumberConverter())->wordOrdinal(1);
first

Ordinal (number + suffix)

Supported number range 1 to 2147483647.

use HnhDigital/PhpNumberConverter;

echo (new NumberConverter())->numberOrdinal(1);
1st

Frameworks

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.