Here's how I do both miles and km'sif(settings.distanceUnits==Sys.UNIT_STATUTE) {
string=(activityInfo.distance/160934.0).format("%.2f")+" mi";
}
else {
string=(activityInfo.distance/(100000.0)).format("%.2f")+" km";
}
You need this: (I do it early in the code so I missed copying that line)var settings=Sys.getDeviceSettings();