|
1234567891011121314151617181920212223242526272829303132333435 |
- <?php
-
- namespace Lc\SovBundle\Component;
-
-
- class NumberComponent
- {
- public function round($price, $precision = 2)
- {
- return round((($price * 100)) / 100, $precision);
- }
-
- public function numberToWord(int $number): string
- {
- $numberWordArray = [
- 'zero',
- 'one',
- 'two',
- 'three',
- 'four',
- 'five',
- 'six',
- 'seven',
- 'eight',
- 'nine',
- 'ten'
- ];
-
- if(isset($numberWordArray[$number])) {
- return $numberWordArray[$number];
- }
-
- return '';
- }
- }
|