inches to feet code example
Example 1: cm to foot
# 1 cm = 0.0328084 foot
# Divide the cm value by 30.48
def cm_to_foot(cm):
return cm/30.48
print(cm_to_foot(1)) # Result- 0.0328084
Example 2: cm to inches
const cm = 1;
console.log(`cm:${cm} = in:${cmToIn(cm)}`);
function cmToIn(cm){
var in = cm/2.54;
return in;
}
Example 3: inch to foot
1 inch = 0.0833333333 foot
Example 4: foot to inch
1 foot = 12 inches