Closed devsi closed 1 year ago
At the moment, no, it is not possible in an easily configurable way. I am currently adding more decimal places to the USD currency by modifying the currency.php
file in the composer post-install and post-update scripts.
<?php
$currenciesFilePath = __DIR__ . '/../vendor/moneyphp/money/resources/currency.php';
$currencies = include $currenciesFilePath;
$currencies['USD']['minorUnit'] = 5;
file_put_contents($currenciesFilePath, sprintf('<?php return %s;', var_export($currencies, true)));
Would a PR making the minor unit of currencies configurable be accepted by this project?
@devsi You can use a custom implementation of a Currencies interface instead of ISOCurrencies
Question is answered.
For example I want to see CAD to 8 decimal places, and calculate at that precision too. Is this possible with moneyphp?