PHP = append a 0 to the end of a string
<p>I have this function which takes the average user rating given to an item and converts it to a relevant class:</p>

<pre><code>function get_user_rating_class($urate_ave){
    if($urate_ave==='0.0'){
        $user_rating_class='unrated_u';
    }else{
        $round_to = 0.5;
        $rounded = round($urate_ave / $round_to) * $round_to;
        $removedec = str_replace('.','',$rounded);
        if(strlen($removedec)&lt;2){$removedec.'0';}
        $user_rating_class='rating_user_'+$removedec;
    }
    return $user_rating_class;
}
</code></pre>

<p>No when I put a value, say 3.0 into the function it should come out as rating_user_30 but instead it is coming out as rating_user_3, so there must be something wrong with this line:</p>

<p><code>if(strlen($removedec)&lt;2){$removedec.'0';}</code></p>

<p>I thought it might be because It was treating the value $removedec as a number rather than a string so I tried adding this line just before it, but no change:</p>

<pre><code>$removedec = strval($removedec);
</code></pre>

<p>Could someone tell me what I am doing wrong here.</p>
