I’ve been using custom fields and before_save logic hooks to round and store relevant currency fields as needed in Swiss Francs.
The smallest unit in CHF is 5 Rappens, i.e. 0.05.
I’m just wondering if there is a more SuiteCRM-inherent way to do this. Maybe the build-in currency unitilities could handle this in a global way?
I saw there’s a config-setting default_currency_significant_digits, but that won’t take care of rounding to 0.05 of course.
As far as I’ve seen the currency fields are always saved in the database with 6 decimal points, but by default are rendered with 2 decimal points in the CRM frontend.
What are you trying to achieve?
As mentioned there’s a config parameter called default_currency_significant_digits (change via config_override.php) that might be of interest?
I’m using a variable for my template, but it displays as 100.000000 & I want it to display as 100.00.
Do you think I can accomplish this with the config_override.php? I found config_override.php, but how would I override the significant digits on invoice currencies? Where can I find documentation on using it?
Not sure about this. My experience has been that all currency fields are rendered correctly automatically… seems like a bug of some sorts?
I’ve never had my currencies show with more than 2 digits after the decimal point. in frontend, Emailtemplates or PDF-Templates.
If you want to futz around with it yourself you should be able to easily do your php magic in /modules/AOS_PDF_Templates/templateParser.php. Just add your own code in the section below:
foreach ($repl_arr as $name => $value) {
(around line 79)