In PHP (using built-in functions) I\'d like to convert/format a number with decimal, so that only the non-zero decimals show. However, another requirement of mine is that if
How about
preg_replace(/\\.$/,'.0',rtrim($value,'0'))