Talk:Multiple Units of Measure

From RadiusWiki

Nikolai:

Hi, Radius,

As you know, I am also from a country with metric system widely used in daily live, so I cannot present myself as somebody who knows the subject. Nevertheless, let me try to express below some theoretical ideas on the subject.

Where is the difference?

Well, there are at least

  1. 2 different measures for Distance Units
    • Kilometres/kilometers
    • Miles (1M = 1.609km) (I believe, UK and US use the same miles for their cars)
  2. 3 different Fuel Units
    • Litres/liters
    • US Gallons (1G = 3.785l)
    • UK Gallons (1G = ???) (UK & US Gallons are definitely differ from each other)
  3. a few different "Economy Units" (consumption or endurance)
    • l/100km
    • km/l (actually endurance - e.g. never used in my country)
    • UK MPG (Mileage - Miles per UK Gallon)
    • US MPG (Mileage - Miles per US Gallon)
    • anything else???
  4. a lot of Currencies :)
    • CZK
    • RUR
    • EUR
    • USD
    • ...

Is it sufficient to have a global option for it?

I believe, global option is not sufficient.

You should distinguish display and entry units. Display units are the units a user expects to get statistics and graphics with. Entry units a user uses to enter fill / expense data.

Display units can be saved as global options, but entry units should be saved extra per every car.


Assume Radius is a Czech man from Europe so he understands metric system well. :) He owns a Skoda for daily usage and an American Hummer for supermarket visits on weekends. And he is a happy user of brand new version of RadiusCar!
When he visits tank station with his Superb, he enters to RadiusCar odometer value in kilometers, fuel volume in liters and money spent in CZK. Visiting the same station with H3, he enters odometer value in miles, fuel filled-in in kiloliters (but tank volume in US Gallons) and money spent in CZK (cause RadiusCar supports different entry units on car basis ;)).
At the same time Radius analyses fuel consumption statistics for both cars in UK MPG (cause Radius spent 10 years in UK and used to use miles, feet, Fahrenheit and UK gallons in his daily live)...
This flexibility is only accessible to Radius, cause only the RadiusCar program offers such functionality ;) - different entry units for every car as well as separate display units.

Disclaimer: All characters and events depicted herein above are purely fictitious and similarity to actual persons living or dead is purely coincidental. :)

Radius: Liar, liar! ;-) I have no Superb, but Skoda Fabia Combi! The differneces are clear, see pictures below

Hummer
Enlarge
Hummer
Fabia Combi
Enlarge
Fabia Combi
Superb
Enlarge
Superb

Nikolai: I do not lie - see disclaimer ;)

Especially in this case - Skoda is anyway a correct assumption :)

Do we really need to convert from one system to another?

Well, it depends.

If you want to save calculation time, you should calculate consumption, endurance, unit costs etc. right after entering new expense and store in the data file not only the "real" initial data, but also some calculated as well. This will reduce time and processor load during all statistical calculations and graphic drawing. Unfortunately the drawback is the fact, that you will use more space (both on file system and in memory) to store the data. And you will have to recalculate and rewrite to data-file all the data if user chooses to change the Display Units in preferences.

If storage is more critical, you should choose to store only initial data entered by user and to store this data internally in common format, e.g. to store everything in metric system. Additional advantage of this approach is the robustness of the program (I mean less probability to make any error in program code and/or in its logic). Disadvantage - a bit more calculations in average.

I have a FSC PocketLoox 720 - a premium line model - and do not expect any performance issues in any of the approaches described above. Your choice, Radius! :)

And have a nice weekend!


Radius

Thanks, I really enjoyed my last weekend with my Hummer H3 :-) Oh, sorry, I wanted to say I enjoyed it with my wife doing xmas shopping 3 days!!! You surely understand I am not too faraway from being dead ;-) Luckily, driving a Hummer was funny.

Ok, let's work... I see no good reason for unit conversions because I do not plan to store pre-calculated values as it has more disadvantages I think. I like raw data even if they are more processor expensive.


Nikolai

I never tried Hummer actually... :(

I fully support your decision not to store pre-calculated values, but cannot agree with storing raw data. Maybe I understand the term "raw" wrong way though.

I believe you should save to data file only the data really entered by end user, and to convert it into metric system internally to store in one common system for any possible combination of display/entry units. Even if user decides to enter data in miles and gallons, RadiusCar should internally convert the data to km & liters and to store it in km & l. Otherwise you will have a lot of troubles with internal conversions as well as with format of data-storage file/table.