can somebody point me in the right direction please to remove decimal places on a different length of a number that sits within a span i.e. the prices of products on a website.
£6.9800
The above should say £6.98
We have a website where some prices are needed to be in 4 decimal places e.g £0.0260 and we have our site setup to display this. But we have other prices where this is not needed e.g. above price and £0.99, £1.99, £10.99, £100.99, £1000.99
Is there a way I can restrict prices to 2 decimal places without any rounding?
I can use JS/Jquery (because my CMS lets me).
I've tried trim and such like but I cant seem to cater for different length numbers (I'm probably just being dumb)
I thought I could use something like this but I'm not 100% sure: http://www.mredkj.com/javascript/numberFormat.html