/** * 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; }
public function testFormatToNumberDecimals() { $result = FormatConverter::formatToNumber("0.0", 4); $this->assertEquals("0.0000", $result); }