I want to add a custom currency (see here) but I have a challenge in the way the price is displayed.

At the moment, £1500 is displayed as £1500.00

I would like to be able to hide the decimals if the price is a whole number, but display them if not.

Also, is there a way to introduce a space into the decimal point, thousands point and left and right symbols?

For example:

I want £1500 to display as 1 thousand 500 pounds but £1499.99 should display as 1 thousand 499 pounds 99 pence

Hope someone can help, thanks in advance.