I need to remove zeros from the end of a string, but only up to 2 places from the right of a decimal point.
I'got a formatted price being handed over as a string, and that price is up to 5 decimal places. I need to strip unnecessary zeros from the price but leaving at least 2 to the right of a decimal place. For example:
£0.00230 -> £0.0023 and £1.50000 -> £1.50
Any help would be appreciated!