Skip to content

KhanovaSkola/cislo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cislo: Integer to czech word translator

Build Status Downloads this Month Stable version HHVM Status

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

About

Translates integers to words and vice versa

Resources

Stars

Watchers

Forks

Packages

No packages published