And this is how it needs to be configured in my case for it to closer match the distance formatting of maps.
distance: (n) => {
var miles = n / 1609.34;
var dp = miles < 10 ? 1 : 0;
return n < 152.4 ? Math.round(n * 3.28084) + "ft" : (miles < 10 ? miles.toFixed(1) : Math.round(miles)) + "mi";
},
So we will need to figure out a way to properly format the distance values based on the users locale. Can this be added to the interface.html of locale?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Great, that was fast!
There was just one other thing that may need to be implemented yet. Formatting the distance to match what maps shows.
In my case it starts showing miles with 1 decimal place at less than 10 miles and switches to 500 feet after 0.1 miles.
This is how the distance is currently formatted in the
locale
file on the watch. This starts showing feet at < 1 mile.And this is how it needs to be configured in my case for it to closer match the distance formatting of maps.
So we will need to figure out a way to properly format the distance values based on the users locale. Can this be added to the interface.html of locale?