Jump to content

Javascript find and replace price ?.


mitnick

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated