Code for calculating

Hi Team,

I am trying to calculate the following:

Example.

65.95 feet…

To show it as being 65feet 11inches

Any suggestions what math code I would use in my code ?

Cheers.

Craig.

Hi Craig,

is his what you are looking for:

var inches =  0.95

func feetToInches(feet: Double) -> Double {
    return inches * 12
}

Blessings,
—Mark

2 Likes

so like mark suggested use his code to get the inches

now to get the decimal of the number refer to this answer from stackoverflow

2 Likes

Perfect Mark…

Thank you !

Cheers

Craig.

Wonderful thank you !

Craig.