Smackie Posted November 25, 2008 Share Posted November 25, 2008 I have been away from PHP for too long lol.. I am have a script that shows Decimals and i want to make it so if after the decimal is 0 it doesn't show the decimal? can someone help me please Thank you Smackie Link to comment https://forums.phpfreaks.com/topic/134158-php-decimals/ Share on other sites More sharing options...
genericnumber1 Posted November 25, 2008 Share Posted November 25, 2008 That's the default behavior... 10.0 will show as 10 10.2 will show as 10.2 Link to comment https://forums.phpfreaks.com/topic/134158-php-decimals/#findComment-698419 Share on other sites More sharing options...
zenag Posted November 25, 2008 Share Posted November 25, 2008 $a=10.00; echo number_format($a,2,'.',''); Link to comment https://forums.phpfreaks.com/topic/134158-php-decimals/#findComment-698422 Share on other sites More sharing options...
Smackie Posted November 25, 2008 Author Share Posted November 25, 2008 hmm thats what i thought.. but my script isn't working right or my server isn't liking it but thanx. Link to comment https://forums.phpfreaks.com/topic/134158-php-decimals/#findComment-698425 Share on other sites More sharing options...
Smackie Posted November 25, 2008 Author Share Posted November 25, 2008 hmm thats what i thought.. but my script isn't working right or my server isn't liking it but thanx. i couldn't find the edit button if there was one.. but i have a problem :-\ even just your script its not working on my local server nor my website server am i doing something wrong? Link to comment https://forums.phpfreaks.com/topic/134158-php-decimals/#findComment-698432 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.