<?php
$array = array(3.0, 3.00, 3.980, 3.543,.33);
foreach ($array as $zahl){
if(ereg(".[0-9]{3,}$", $zahl)){
echo "Zahl $zahl hat mehr als 2 Nachkommastellen<br>\n";
$zahl = sprintf("%01.2f", $zahl);
}
else{
echo "Zahl $zahl hat nicht mehr als 2 Nachkommastellen<br>\n";
}
echo $zahl."<br>";
}
?>
bei welchen Zahlen macht denn das obige Skript nicht was Du willst???