Convert decimal feet to feet and inches?
问题 How would I go about converting a measurement from, for example, 12.5 feet to 12ft 6in? How would I created that second number which reads only the decimal place when multiplying by 12? right now I have double Measurement01 using other variables and some math to get me the feet in decimals. I send that to a textview with farf.setText(Measurement01 + " " + "ft"); Any help would be appreciated! 回答1: Substract the integer portion: float measurement = 12.5; int feet = (int)measurement; float