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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
doni49 Posted November 18, 2006 Share Posted November 18, 2006 Glad to help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.