Created
July 12, 2011 01:33
-
-
Save ctrl-freak/1077210 to your computer and use it in GitHub Desktop.
Moneyify MySQL DECIMAL Value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function moneyify($value) { | |
$value = ((int)$value == (float)$value) ? (int)$value : (float)$value; | |
$value = number_format($value); | |
return $value; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment