Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to read documentation User-settings

ANSWERED

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!

Best Answer
1 BEST ANSWER

Accepted Solutions

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

 

View best answer in original post

Best Answer
1 REPLY 1

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

 

Best Answer