Jump to content

chelle_k

Member
  • Posts

    0
  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    chelle_k reacted to brandon in Can someone help me change coding to get rid of decimal places in my pricing?   
    Hi. The following Javascript, inserted via footer code injection should do the trick:
    <script> (function() { var prices = document.getElementsByClassName('sqs-money-native'); var thisPrice; var i, I; for (i=0, I=prices.length; i<I; i++) { thisPrice = prices[i]; thisPrice.innerHTML = thisPrice.innerHTML.replace(/(\.[0-9]*?)0+$/, "$1").replace(/\.$/, ""); //http://stackoverflow.com/questions/1015402/1015434#1015434 } })(); </script>
    I didn't test this throughout your site...just checked a couple pages. Do let me know if this works for you.
    -Brandon

    If this or any other answer helps you out, please give credit where credit is due: Accept the answer if you're the poster or Up-Vote the answer if you're not the poster. If it didn't help, feel free to inquire further or wait and see what others have to say. Code is provided without any warranty, expressed or implied.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.