0

I'm coding a simple one-page web app/calculator. It has a switch between metric and imperial units.

What I'd like to do, however, is pre-select the (probably) correct option for the user to improve the UX.

I was wondering how would I determine what units the user uses. I can determine their timezone, but I couldn't find any timezone to units conversion array.

How would one go about solving this?

Frantisek
  • 7,485
  • 15
  • 59
  • 102
  • 3
    There is no auto conversion, since timezones have nothing to do with what unit system is used by a user. That old imperial system is not bound to a geographic width (a timezone), but to historical developments. Only countries that did not switch to the more modern, more logical and more efficient system still use it. So you'd have to use a catalog, not a formula to predict by means of the users country, not by his timezone. There might be a catalog, but since only few countries are left that do _not_ use the metric system it should be easy to build one yourself. – arkascha May 25 '14 at 11:01
  • It can also be a personal choice, in the UK some people like feet and inches, whilst others prefer meters etc. It is quite often based on age. There is no point in trying to predict. – vascowhite May 25 '14 at 11:10

2 Answers2

4

Timezones don't necessarily mean that you are in one of the countries that uses the imperial system.
There is very few countries (3 of them, Burma, Liberia and USA (UK to some extent too i guess..)), so best bet would be to check what country the user is from.

Check the following link to get some information on how to get country name from IP, which is the way I personally would do this. Getting visitors country from their IP
Then just check if the user is from one of the three countries.

Community
  • 1
  • 1
Jite
  • 5,761
  • 2
  • 23
  • 37
  • 2
    Note that the US doesn't actually use Imperial units, it uses `US Imperial` that are often different to `standard Imperial`, particularly for fluid measures.... http://en.wikipedia.org/wiki/Comparison_of_the_imperial_and_US_customary_measurement_systems – Mark Baker May 25 '14 at 11:05
  • I often find it degrading in website and webapp usage experience if the IP is used for detecting a country which has influence on user settings. – hakre May 25 '14 at 11:12
1

You do that by asking the visitor. Most visitors are intelligent enough to choose either of those systems, but not all might want to and are lazy enough to not choose.

So if you want to differ, you have to ask the visitor to differ for what.

However, I would conquer that problem a little different and less technical: First of all I would take the one I think is better. Then I would wait for complaints (or just feedback in general to base my decision on - which is actually asking the visitor as suggested above if you follow me).

Just defer what varies and do first things first.

hakre
  • 193,403
  • 52
  • 435
  • 836
  • There's nothing wrong with pre-checking/pre-selecting/pre-filling the values for your users if you want them to use your site as much as possible. – Frantisek May 25 '14 at 11:09
  • @RichardRodriguez: There ain't. However I would decide that for the user, so there is some design and architecture with the application which knows for a non-technical reason what is better for the user. – hakre May 25 '14 at 11:10