Advertisement
killerbng

Convert php style

Mar 16th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. function cm2ft($cm){
  2.     $calc = $cm * 0.032808;
  3.     $ft = round($calc);
  4.     $inches = $calc - $ft;
  5.     $inches = round($inches * 10);
  6.     $ft_in = $ft."ft ".$inches."in";
  7.     return $ft_in;
  8. }
  9. function kg2lbs($kg){
  10.     $convert = $kg * 2.2046;
  11.     $lbs = number_format((float)$convert, 3, '.', '');
  12.     $lbs_converted = $lbs + "lbs";
  13.     return $lbs_converted;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement