Thursday, March 22, 2007

パーセントの計算

sub count_rate {
my ($numerator,$denominator) = @_;
if ( $numerator > 0 && $denominator > 0){
return sprintf("%.1f",($numerator / $denominator)*100);
}else{
return 0;
}
}

No comments: