Skip to content

Commit

Permalink
PHP Extension Intl
Browse files Browse the repository at this point in the history
  • Loading branch information
Pharaonic committed Nov 6, 2020
1 parent 07ebffd commit 3b51e22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

- ###### Number. (1,020,304,050,607,080)

- ###### NumberToString. ( seven thousand seven hundred twenty-one )
- ###### NumberToString. ( seven thousand seven hundred twenty-one ) {PHP Extension intl}

- ###### HumanNumber. ( 77K || 77.4K || 77.37K )

Expand Down
3 changes: 2 additions & 1 deletion src/Readable.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public static function getNumberToString($input, string $lang = 'en'): string
if (!in_array(gettype($input), ['integer', 'double', 'float'])) throw new TypeError("Wrong Input Type.");

$digit = new \NumberFormatter($lang, \NumberFormatter::SPELLOUT);
return $digit->format($input);
$input = $digit->format($input);
return $lang == 'ar' ? str_replace('و ', 'و', $input) : $input;
}

/**
Expand Down

0 comments on commit 3b51e22

Please sign in to comment.