Guest Posted November 17, 2006 Share Posted November 17, 2006 I need a way to add commas to every thousad dollars and it could go up to millions. And i want a way to remove the cents from the variable. Can somebody help me please. Link to comment https://forums.phpfreaks.com/topic/27541-resolved-dollar-handleing/ Share on other sites More sharing options...
Seraskier Posted November 17, 2006 Share Posted November 17, 2006 explain your situation and please put up your code. Link to comment https://forums.phpfreaks.com/topic/27541-resolved-dollar-handleing/#findComment-125977 Share on other sites More sharing options...
doni49 Posted November 17, 2006 Share Posted November 17, 2006 [code]<?php$number = 1234.56;// english notation (default)$english_format_number = number_format($number); // returns1,235$english_format_number = "$" .english_format_number; // <--this will add the dollar sign in front of the number.?>[/code]www.php.net/number_format Link to comment https://forums.phpfreaks.com/topic/27541-resolved-dollar-handleing/#findComment-125979 Share on other sites More sharing options...
Guest Posted November 17, 2006 Share Posted November 17, 2006 That is what i needed thank you so much. Link to comment https://forums.phpfreaks.com/topic/27541-resolved-dollar-handleing/#findComment-126025 Share on other sites More sharing options...
doni49 Posted November 18, 2006 Share Posted November 18, 2006 Glad to help. Link to comment https://forums.phpfreaks.com/topic/27541-resolved-dollar-handleing/#findComment-126486 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.