Check if imperial units are default¶
A function that returns a boolean informing about the default measurement system in the user’s country.
Note
If you want to obtain the location of the user, the recommended function is getCountryCode available inside onInit context.
The function doesn’t inform about the current choice of units but only about the default system of measurement (imperial vs metric).
Syntax¶
To check whether the user’s country follows the imperial system of units or not and save the resulting boolean in a variable use:
var defaultImperial = ctx.usesImperialUnits();
Warning
This function only works inside a onResult context.