Browse Source

NumberComponent

develop
Guillaume 3 years ago
parent
commit
770dbf6a84
1 changed files with 21 additions and 0 deletions
  1. +21
    -0
      Component/NumberComponent.php

+ 21
- 0
Component/NumberComponent.php View File

return round((($price * 100)) / 100, $precision); 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 '';
}
} }

Loading…
Cancel
Save