10-13-2017 16:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-13-2017 16:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
I want to know if the user preferences are for US or METRIC, but not sure of the code to check this.
Do I need to:
import { distance } from "user-settings";
and then how do I get the value 'us' or 'metric' ?
I can usually figure things from example code, but don't understand from reading the docs on https://dev.fitbit.com/reference/device-api/user-settings/#interface-unitssettings-
Cheers!
Answered! Go to the Best Answer.
Accepted Solutions
10-13-2017 16:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-13-2017 16:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
We're working to provide examples on the reference docs to make them easier to use.
import { units, locale, device, preferences } from "user-settings";
//units.distance === "metric" ? "kilometers" : "miles";
//units.speed === "metric" ? "km/h" : "mph";
//etc
10-13-2017 16:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-13-2017 16:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
We're working to provide examples on the reference docs to make them easier to use.
import { units, locale, device, preferences } from "user-settings";
//units.distance === "metric" ? "kilometers" : "miles";
//units.speed === "metric" ? "km/h" : "mph";
//etc
