Skip to content

arius86/number-formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arius/number-formatter

Build Status Coverage Status SensioLabsInsight

PHP NumberFormatter extended with additional ordinals not supported by ICU.

Feel free to add more languages. Fork, pull request and contribute!

How to

  1. composer.json

{
     "require": {
        "arius/number-formatter": "1.*"
     }
}
  1. PHP

Use in code just like NumberFormatter class.

use Arius\NumberFormatter;

$formatter = new NumberFormatter('pl', NumberFormatter::SPELLOUT);
$formatter->setTextAttribute(NumberFormatter::DEFAULT_RULESET, "%spellout-ordinal");

$formatter->format(123);

Additional supported ordinals

  1. Polish (pl)

  • spellout-ordinal
  • spellout-ordinal-feminine
  • spellout-ordinal-masculine
  • spellout-ordinal-neuter
  1. Russian (ru)

  • spellout-ordinal
  • spellout-ordinal-feminine
  • spellout-ordinal-masculine
  • spellout-ordinal-neuter
  • spellout-ordinal-plural (plural isn't part of ICU in all languages)

About

PHP NumberFormatter extended with additional ordinals.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages