khanovaskola / cislo
Translates integers to words and vice versa
v1.5
2015-02-20 21:08 UTC
Requires
- nette/utils: ~2.2
Requires (Dev)
- nette/tester: ~1.3
This package is not auto-updated.
Last update: 2024-10-26 17:19:03 UTC
README
Installation
With composer:
composer require khanovaskola/cislo '@dev'
Usage
use KhanovaSkola\Cislo; Cislo::parse('nula'); // 0 Cislo::parse('jedna'); // 1 Cislo::parse('jeden'); // 1 Cislo::parse('pětadvacet'); // 25 Cislo::parse('tisíc devět set dvacet pět'); // 1925 Cislo::parse('devatenáct set dvacet pět')); // 1925 Cislo::parse('jeden tisic devet set a dvacet pet'); // 1925 Cislo::parse('garble'); // KhanovaSkola\\InvalidArgumentException Cislo::toWord(0); // nula Cislo::toWord(1337); // tisíc tři sta třicet sedm Cislo::toWord(3e8); // tři sta milionů Cislo::toWord(1e9); // KhanovaSkola\\OutOfRangeException