for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Palmtree\Csv\Normalizer;
class MoneyNormalizer extends AbstractNormalizer
{
private string $moneyFormat = '%.2n';
/**
* Sets the format passed to money_format. Defaults to %.2n which formats the number according to the current
* locale's national currency format rounded to 2 decimal places. e.g for en_GB: £1,234.56.
*/
public function format(string $moneyFormat): self
$this->moneyFormat = $moneyFormat;
return $this;
}
protected function getNormalizedValue(string $value): string
return money_format($this->moneyFormat, (float)$value);
return money_format($thi...Format, (double)$value)
null
string