Re: Conversion component Meter/Feet-Inch
- From: "Allan Knox" <ccc**at*btinternet.com>
- Date: Wed, 28 Nov 2007 15:10:24 -0000
Nils,
I note that all respondents so far has ignored the subtle complexity of your problem in that there are 2 (mathematically) trivial adjustments required and not just one. However, the problem remains simple and does not need a full component, especially as only you know whether or not you want to round up, round off, or truncate the result and whether you want to consider fractions of an inch or have a specific number of decimal places of accuracy. Assuming you know the answers to those last points, rolling your own code would be the best to keep it simple.
As you have asked the question at all, one has to assume that you are not intimately associated with the concepts of conversions using either integers (TRUNC) and fractions (FRAC), or MOD and DIV. You just need one of those pairs of functions, as you prefer, in addition to a simple multiplication.
To convert from feet and inches to metres, simply multiply the number of feet by 12, add the number of inches, and divide the result by 39.37 (or 39.3700784 for better accuracy). Round off as required. Don't use the result to build bridges!
To convert from metres to feet and inches, choose either:
a. Multiply the metres by 39.37, giving the result in inches (just inches at this stage). Round off or truncate as required to an integer. Then use DIV 12 of the integer result to give you the number of feet, and MOD 12 to give you the number of inches.
or
b. Multiply the metres by 3.28 (or 3.2808399) to give you the result in feet with decimal places. Then take the TRUNC of the result to give you integer feet and multiply the FRAC of the result by 12 to give you the number of inches as a float which should then be rounded or truncated as required for your purpose.
Regards
Allan Knox
(hoping I have not misunderstood your question and insulted your intelligence)
"Nils Boedeker" <NilsBoedeker@xxxxxxxxxxx> wrote in message news:474d4223@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi
exist an component that conversion meter to feed/inch and backwards ???
with best regards from germany
Nils Bödeker
.
- Follow-Ups:
- Re: Conversion component Meter/Feet-Inch
- From: Nils Boedeker
- Re: Conversion component Meter/Feet-Inch
- From: Allan Knox
- Re: Conversion component Meter/Feet-Inch
- References:
- Conversion component Meter/Feet-Inch
- From: Nils Boedeker
- Conversion component Meter/Feet-Inch
- Prev by Date: Re: Conversion component Meter/Feet-Inch
- Next by Date: Re: ANN: BTActiveMQClient - Apache ActiveMQ messaging system client
- Previous by thread: Re: Conversion component Meter/Feet-Inch
- Next by thread: Re: Conversion component Meter/Feet-Inch
- Index(es):
Relevant Pages
|
Loading