I have a quick question. I have a function like this:
function clean_num($num){
return trim(trim($num, '0'), '.');
}
So when I have numbers like 85.00 and 55.00 it takes off the .00 and just returns 85 and 55.
Well I have a number 0.00 and what happens is it is returning blank. It should just say 0 but I am not getting a result at all.
How can I modify this function to get what I am looking for?
Thanks!
trim()works on both ends. To only trim on the right end, usertrim().