Forum Moderators: coopster
I can not change the incoming data, it's just a $_POST
I can not change the database
and worst of all:
I can not test this script! it's on a server working on live data - if I change and test it, it'll inject bogus data into the pool. A very Schrodingerian situation.
We've been getting errors when someone enters a non-numeric value for Price, eg "$US 9.00" or "13.00-14.00". So far we've been handling the errors by manually reentering the values.
it's gotten worse since the site has gained more popularity in Europe, and now we're seeing more prices like "95,00" and "95-" and "95,--"
I need a bulletproof method of converting all sorts of numeric and pseudonumeric strings into floats.
I'd be especially careful about strings like "10,00" and "10,000". One is $10 eurostyle, the other is $10000 britishstyle. Huge difference.
what do you think? is there a decent function for this already "out there"?