You are here: Re: Convert Feet to Metres « PHP « IT news, forums, messages
Re: Convert Feet to Metres

Posted by Alan Lord on 11/02/05 16:16

Shaun wrote:
> Hi,
>
> I am trying to create a function that will convert metres to feet and vice
> versa. After searching Google I have found that 1 meters = 3.2808399 feet.
> However if someone enters 10.5 to mean 10 feet and 5 inches this is not the
> same as 10 feet and half a foot as there are 12 inches in a foot!
>
> Is there a standard conversion for this problem?

Make the interface clear (perhaps have separate text boxes for metric or
imperial entry) so that they enter Feet and Inches rather than a decimal
notation, which is not common anyway. Then calculate the total inches,
multiply by 25.4 and divide by 1000.

Of course you also need to handle fractions... Most Americans I believe
(I'm English) would write 10 5/16" for example.

Hope this helps.

Alan

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация