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