Please guide me an issue, I am getting a price from the server as below (as an example)
two hundred forty-two
and I want to convert this value into 242.00.
Please guide me on how to convert it.
I know we can use .spellOut with NumberFormatter for converting value into String but can't find a way to do the above.
CodePudding user response:
Alright, you have managed to nerd-snipe me.
I've implemented a number string parser as a Swift package. I don't expect you to bring in a whole package just to do this, but you might find some inspiration here: