In Magento I have a savings box, which calculates how much you save based on the difference between the regular and discount price.
The problem is the number I calculate isn't formatted. How do I format that price using javascipt? I do want it to be dynamic so that I don't have to change it when I use an other currency.
<?php $priceFormat = Mage::helper('core')->jsonEncode(Mage::app()->getLocale()->getJsPriceFormat()); ?> <script> formatCurrency(p.c_old_price, <?php echo $priceFormat ?>); </script>
The suggested optionsPrice didn't work for me, since it has not JSON configuration (it only works for products containing options, which makes no sense for me! It seems to be obsolete Magento code)