mysql - Handling regional currency variations in PHP - e.g. different uses of full stops versus commas -
I'm pretty sure this should be as easy as I am making it. I have a customer who provides loans to businesses and people to the site.
This problem comes with people's entry. I have to break the currency symbols, after losing all the units, nothing has to be lost (in most cases a sterling - so lose pence) and convert the final number into a format that can be repeated in a database table in a third party. Most of the above were working- so far, we are meeting the users of mixing thousand separators and decimal separator so that one intends to complete the work if there is a thousand SEP or a decimal set-up.
Anyone got a clever solution? What is the Rijks Way?
Thanks,
Steve
I will do this ( It is ok to handle your input, do not have any illegal input like "$ 6,00,00" or "777.7.98, $ 8938" or "hi mama"):
- Find currency sign and It can be a bar, it can be at the beginning or end and can be more than one character, like "USD", "CHF" and so on.
- See if the decimal separator (
- all the places, all the commas, all the points, all
' - I do not think that finally add,
- To 100
- To 100
Comments
Post a Comment