HELP -> Change 2,500,000.40 to 2500000.00
Posted: Fri Dec 16, 2005 10:08 am
How do i change this variable to 2 decimals??? 2,500,010.40 -> 2500010.40
Any idea how I do this??? Thnx...
Any idea how I do this??? Thnx...
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
pido wrote:How do i change this variable to 2 decimals??? 2,500,010.40 -> 2500010.40
Any idea how I do this??? Thnx...
Code: Select all
$teh_numbar = '2,500,010.40';
$teh_numbar = round(floatval((str_replace(',', '', $teh_numbar))), 2);Code: Select all
$myNumber = '2,500,010.40';
$result = str_replace(',', '', $myNumber);