I'm using this function to return a number which ends in .5 as a html ½ so 6.5 would become 6½ but for some reason 15.5 comes out as ½½, what should it be please?
function Fractionalise($value) {
if ($value=="0.5") {
$value = "½";
}
else {
if (preg_match("/\.5[0]{0,}$/", $value)) $value = preg_replace("/.5[0]{0,}/", "½", $value);
}
return $value;
}