mitnick Posted January 3, 2008 Share Posted January 3, 2008 Hi Guys, I am having issues since WHMCS does not support currencies such as X.XXX and always converts this to XX.00 however i can insert price such as XXXX.00 but i wan´t to remove the ".00" from the price. Since the files are encoded and i can´t edit them, i was wondering if i could do this by Javascript?. Such as let the javascript find the ".00" and remove it or replace with nothing "" ?. I really appreciate all help on this one... Thank you. 0 Quote Link to comment Share on other sites More sharing options...
Brett Posted January 3, 2008 Share Posted January 3, 2008 This can easily be done with smarty. Now, I have not tested this but I am sure it will work. You will have to find all of the occurrences of this in your templates. You are looking for: {$invoice.total} Replace with: {$invoice.total|replace:'.00':''} What it is telling it to do is replace .00 with nill. Here is the Smarty page on it - http://www.smarty.net/manual/en/language.modifier.replace.php I would test this in clientareahome.tpl Just ask if this does not make sense. Brett 0 Quote Link to comment Share on other sites More sharing options...
Brett Posted January 3, 2008 Share Posted January 3, 2008 Here is another way. It will replace a string. {$invoice.total|regex_replace:"/[.00.01.02.03.04]/":""} I am unsure how this works, but I think it will work. 0 Quote Link to comment Share on other sites More sharing options...
mitnick Posted January 3, 2008 Author Share Posted January 3, 2008 Hey Brett, Thank you for quick respond and this works like a charm "{$invoice.total|replace:'.00':''}" It now removes the .00 from XXXX.00 I was just wondering since this is possible, is it even possible to change the currency to show a dot after each thousand such as X.XXX and XX.XXX ?. And again, thank you so much. 0 Quote Link to comment Share on other sites More sharing options...
Brett Posted January 3, 2008 Share Posted January 3, 2008 I looked all through the Smarty docs, but I was unable to find how to do this. I'm sure there is a way. Perhaps someone else has a suggestion? By the way, welcome to the forums mitnick! This is a great community! 0 Quote Link to comment Share on other sites More sharing options...
twinbros Posted January 28, 2008 Share Posted January 28, 2008 Interesting question, do you find any way to separate at each thousand? 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.