Hi, does anyone know how to round distance to 2 decimal places, I have the formula for calculating distance in miles but it goes to several decimal places, I’d like it to only display 2? For example, instead of 4.12344626 etc it would show 4.12
Welcome - this is the best watchface making community there is - you will always find help here. I recommend you reading all the posts here as most questions have been asked and answered previously. Use the search box in the top right hand corner and you will more than likely find your answer and if you really get stuck you can post here and you will get help for sure
You will find everything you need about steps converted into miles/kilometer calories and amount of time walking, in the tutorial by TOMAJA here: [TOMAJA Mini Tutorial] How to Convert Steps into Miles, Kilometres, Calories & Sport Time
The mentioned tutorial is good for providing formulas in general, meanwhile was the set of available functions extended with the toFixed(number, digits) function, which truncates a number to a decimal precision based on the digits value specified. For example (toFixed (4.12344626, 2)) returns 4.12 (do not forget to put the whole formula in brackets, for the result to be displayed as number).
Wow That’s a brilliant Tutorial there my friend
That’s brilliant, toFixed works fine, many thanks!
the cavalry, … quick and fast!