magj Posted November 19, 2014 Share Posted November 19, 2014 Hi I've had this issue but no answer to it is found, I want to remove decimal points from prices in all views like quote ....., I changed the format of default currency to 1,234 but I see the numbers come with .00 decimals. How can I remove them? It seems not be possible, isn't it?? Even with tweaking the smart tags with something like: {$total|number_format:0} ! Any help would be greatly appreciated Regards 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 19, 2014 Share Posted November 19, 2014 it won't work using number_format as some of these variables aren't just numbers (e.g they also include currency symbols etc)... I can think of two ways to do this... if you want to go down the Smarty route of editing the templates, you could use... {$total|regex_replace:'/[.,][0-9]+/':''} that should remove the two decimal places from the value... the other way would be to modify the database table structures and change the decimal setting from '2' to '0' - similar to the procedure outlined below... http://forum.whmcs.com/showthread.php?90090-More-demicals-in-configurable-options&p=379431#post379431 although if you are unfamiliar with modifying MySQL structures, then I wouldn't suggest trying this on a live whmcs site! quoting one of the whmcs support guys... Shouldn't be any adverse effects from this work around but, as always, this has not been fully tested and cannot be supported by WHMCS. So be sure to test the changes before you apply them to a production install of WHMCS. also, it's entirely possible that some of the values are coded to show to 2 decimal places regardless of the database setting, so changing the db structure to 0 decimal places might not always work. I assume that you aren't adding tax to your prices as that would have to be calculated exactly and not rounded to 0 decimal places. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.