I would like to remove trailing zero's according to the following rules:

* The input number will always have 4 decimal places
* The output number should always have between 2 and 4 decimals
* If the last two digits after the decimal is a zero, then remove both of them
* If the last digit after the decimal is a zero, then remove it

Examples:

* 1.0000 -> 1.00
* 1.4000 -> 1.40
* 1.4100 -> 1.41
* 1.4130 -> 1.413
* 1.4136 -> 1.4136

I have considered the following:

```
if (substr($number, -2) == '00') return substr($number, 0, 4);
if (substr($number, -1) == '0') return substr($number, 0, 5);
return $number;

```

Are there any better ways of doing this?