I am trying to make a simple objective-C height converter. The input is a (float) variable of feet, and I want to convert to (int) feet and (float) inches:
f
As answered earlier, subtracting is the way to go. Just remember to convert the one tenths of feet to inches by multiplying with 12:
float totalHeight = 5.122222; int myFeet = (int) totalHeight; float myInches = (totalHeight - myFeet) * 12;