Very useful php function to convert centimeter to display as Feets and inches. This function is used to calculate height of celebrities.
function cm2feet($cm) {
$inches = $cm/2.54;
$feet = intval($inches/12);
$inches = $inches%12;
return sprintf('%d \' %d "', $feet, $inches);
}
function cm2feet($cm) {
$inches = $cm/2.54;
$feet = intval($inches/12);
$inches = $inches%12;
return sprintf('%d \' %d "', $feet, $inches);
}
No comments:
Post a Comment