|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
-
-
-
- namespace common\helpers;
-
- class Price
- {
-
- public static function format($number)
- {
- return self::numberTwoDecimals($number).' €';
- }
-
- public static function getPrice($priceWithTax, $taxRate)
- {
- return floatval($priceWithTax) / ($taxRate + 1);
- }
-
- public static function getPriceWithTax($priceWithoutTax, $taxRate)
- {
- return floatval($priceWithoutTax) * ($taxRate + 1) ;
- }
-
- public static function numberTwoDecimals($number)
- {
- return number_format(((int) ($number * 100)) / 100, 2) ;
- }
-
- }
|