# format number if($zahl==0) { $zahl='0'; } else { $zahl=sprintf("%.${pos}f",$zahl); $zahl=~s/\.?0+$// if(index($zahl,'.')>0) }