i use jquery plugin manage currency input autonumber .
from input, got string : 30,103,437.60
now in post, have :
array ( [0] => array ( [id_invoice] => 83 [description] => repair [quantity] => 1 [price] => 1,523,000.50 ) )
please see in [price]
. in database, set price field decimal(10,2)
. so, got 1.00
in database. think because comma on post->price = 1,523,000.50
.
my question is, how can save on database right format ? using php.
your actual number should separate formatting can show different users using locale appropriate formatting. use number_format
, money_format
etc. in php , use appropriate locale go , fro number formatted number , back. if using jquery plugin formatting, don't understand why has make way database is.