This function is based on a script by Tim Dietrich (tim@timdietrich.us) named format_height.sql. His function took what he called a decimal representation of a measurement and formatted it as feet and inches. In reality the input value was just a measurement formatted to look like a decimal number but it was not a true decimal number.

It is more likely that you would find a measurement stored in a DB field as a true decimal value and have to convert and format it as this function does.

For example, a measurement of 5 feet 9 inches, which would be passed in as the decimal 5.75, would be returned as 5'9".

Similarly, a measurement of 4 feet 11 inches, which would be passed in as the decimal 4.90, would be returned as 4'9".

2001-08-22

690 reads