I\'d like to know if exists some function to automatically format a number by it\'s decimal, so if I have:
I've been accused of doing something like this:
floatval($foo) == intval($foo) ? number_format($foo) : number_format($foo,2);