utilizza is_float().

if(is_float($val) ) number_format()
else $val