<?php
namespace App\Utils\BaseParser\Structure\StructureParser\Structures\Base; abstract class Price extends \App\Utils\BaseParser\Structure\StructureParser\Structures\Base\Base { protected function floatsAreEqual($price1, $price2) { return (sprintf("%.2f", $price1)===sprintf("%.2f", $price2)); } protected function floatIsZero($price) { return abs($price)<0.0001; } protected function floatIsNegative($price) { return $price<0.0001; } protected function floatIsPositive($price) { return $price>0.0001; } protected function floatInvert($price) { return 0.00 - $price; } protected function ceilToPrecision($number, $decimals) { return ceil($number * pow(10, $decimals))/pow(10, $decimals); } protected function floorToPrecision($number, $decimals) { return floor($number * pow(10, $decimals))/pow(10, $decimals); } protected function roundToPrecision($number, $decimals) { return round($number, $decimals); } } 