Last active
March 16, 2019 06:31
-
-
Save FreshLondon/9f95ce73867df7a001c12583cbbfe414 to your computer and use it in GitHub Desktop.
Function: metres to feet and inches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? function metersToFeetInches($meters, $echo = true) { | |
$m = $meters; | |
$valInFeet = $m * 3.2808399; | |
$valFeet = (int)$valInFeet; | |
$valInches = round(($valInFeet - $valFeet) * 12); | |
$data = $valFeet."′".$valInches."″"; | |
if ($echo == true) { | |
echo $data; | |
} else { | |
return $data; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment