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"):

  1. 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.
  2. See if the decimal separator (
  3. all the places, all the commas, all the points, all ' - I do not think that finally add,
  4. To 100

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -