|
-
April 21st, 1999, 03:19 PM
#1
Switching between two type of units
Hi,
In my application I have two type of units - english and northamerican style i.e, lbs and Kgs ( for weight, etc.). Is there any easier way to toggle between the two types rather than writing code for each??
I will appreciate your hints and ideas.
Thanks.
-
April 21st, 1999, 04:34 PM
#2
Re: Switching between two type of units
You might try something like this: Carry a variable of some type in your program to tell you what unit system you want to work with. Then add a 'conversion factor' to all your calculation routines. Write all your calculation code but replace Units with (Units * Conversion Factor). Then all you have to do is check which unit system you are in and adjust the conversion factor appropriately.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|