|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static function format($number) |
|
|
public static function format($number) |
|
|
{ |
|
|
{ |
|
|
return str_replace('.', ',',number_format($number, 2)) . ' €'; |
|
|
|
|
|
|
|
|
return self::numberTwoDecimals($number).' €'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static function getPrice($priceWithTax, $taxRate) |
|
|
public static function getPrice($priceWithTax, $taxRate) |
|
|
{ |
|
|
{ |
|
|
return round(floatval($priceWithTax) / ($taxRate + 1), 2); |
|
|
|
|
|
|
|
|
return floatval($priceWithTax) / ($taxRate + 1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static function getPriceWithTax($priceWithoutTax, $taxRate) |
|
|
public static function getPriceWithTax($priceWithoutTax, $taxRate) |
|
|
{ |
|
|
{ |
|
|
return round(floatval($priceWithoutTax) * ($taxRate + 1), 2); |
|
|
|
|
|
|
|
|
return floatval($priceWithoutTax) * ($taxRate + 1) ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static function numberTwoDecimals($number) |
|
|
|
|
|
{ |
|
|
|
|
|
return number_format(((int) ($number * 100)) / 100, 2) ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |