public static function formatToNumber($value, $decimals = 2) { if (trim($value) != null) { return number_format($value, $decimals, '.', ''); } return null; }
/** * Cost in percent. Range of 0 to 100. * * @param string $percent * * @return $this */ public function setPercent($percent) { NumericValidator::validate($percent, "Percent"); $percent = FormatConverter::formatToNumber($percent); $this->percent = $percent; return $this; }