examples/bmi-calculator-advanced/react/main.js
function cm2feetInches (cm) {
  const totalInches = (cm * 0.393701);
  let feet = Math.floor(totalInches / 12);
  let inches = Math.round(totalInches - (feet * 12));
  if (inches === 12) {
    feet += 1;
    inches = 0;
  }
  return { feet, inches };
}
function cm2feetInches (cm) {
  const totalInches = (cm * 0.393701);
  let feet = Math.floor(totalInches / 12);
  let inches = Math.round(totalInches - (feet * 12));
  if (inches === 12) {
    feet += 1;
    inches = 0;
  }
  return { feet, inches };
}
function cm2feetInches ( cm ) { const totalInches = ( cm * 0.393701 ) ; let feet = Math . floor ( totalInches / 12 ) ; let inches = Math . round ( totalInches - ( feet * 12 ) ) ; if ( inches === 12 ) { feet += 1 ; inches = 0 ; } return { feet , inches } ; }
convert a length in centimters to feet and inches components,
rounding to the nearest inch
convert a length in centimters to feet and inches components rounding to the nearest inch