Discuss Eliminate thousand dot for thousands only in the PHP Development forum on Dev Shed. Eliminate thousand dot for thousands only PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
Time spent in forums: 14 h 21 m 16 sec
Reputation Power: 0
Eliminate thousand dot for thousands only
I have a database mysql with decimal (10.2) columns,
so I need the price to insert like this 2456.75
Often amounts copied from banks are inserted, and the banks displays like this 2.456,75, and of course a copy and paste is imposible as if I try to insert the amount displayed in bank the amount of 2.45 will be inserted.
To change the coma for a dot I use this:
$cantidad = str_replace(",", ".", $cantidad);
However the dot for the thousands must be taken away before inserting,
I cant do the same for the dot (replace '.' with '') as when we insert manully without copying and pasting we do it correctly writing 2456.75 to insert.
Anyway of deleting the dot but only for thousands?