diff --git a/README.md b/README.md index 87e904d..9525b32 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ use PHPHumanizer\String; echo String::humanize('field_name'); // "Field Name" echo String::humanize('user_id'); // "User" -echo String::humanize('field_name', true); // "field name" +echo String::humanize('field_name', false); // "field name" ``` ## Number @@ -78,7 +78,7 @@ Number can be also formatted for specific locale ```php use PHPHumanizer\Number; -echo Number::binarySuffix(1536, 'pl'); "1,5 kB" +echo Number::binarySuffix(1536, 'pl'); // "1,5 kB" ``` **Metric Suffix** diff --git a/spec/PHPHumanizer/NumberSpec.php b/spec/PHPHumanizer/NumberSpec.php index 1e2948c..344e921 100644 --- a/spec/PHPHumanizer/NumberSpec.php +++ b/spec/PHPHumanizer/NumberSpec.php @@ -16,13 +16,13 @@ function it_ordinalizes_numbers() $this->ordinalize(-111)->shouldReturn("-111th"); } - function it_returns_oridinal_suffix() + function it_returns_ordinal_suffix() { - $this->oridinal(1)->shouldReturn("st"); - $this->oridinal(2)->shouldReturn("nd"); - $this->oridinal(23)->shouldReturn("rd"); - $this->oridinal(1002)->shouldReturn("nd"); - $this->oridinal(-111)->shouldReturn("th"); + $this->ordinal(1)->shouldReturn("st"); + $this->ordinal(2)->shouldReturn("nd"); + $this->ordinal(23)->shouldReturn("rd"); + $this->ordinal(1002)->shouldReturn("nd"); + $this->ordinal(-111)->shouldReturn("th"); } function it_convert_number_to_string_with_binary_suffix() diff --git a/src/PHPHumanizer/Number.php b/src/PHPHumanizer/Number.php index 9a7ae1e..fff15b3 100644 --- a/src/PHPHumanizer/Number.php +++ b/src/PHPHumanizer/Number.php @@ -10,10 +10,10 @@ class Number { public static function ordinalize($number) { - return $number . self::oridinal($number); + return $number . self::ordinal($number); } - public static function oridinal($number) + public static function ordinal($number) { return (string) new Ordinal($number); }