Method to remove or strip trailing zeros of a decimal number:
<?php function clean_num( $num ){ $pos = strpos($num, '.'); if($pos === false) { // it is integer number return $num; }else{ // it is decimal number return rtrim(rtrim($num, '0'), '.'); } } ?>
Works on numbers: 0.02=0.02; 4.000=4; 80=80.

sorry abt that - vote , this script works well.