This passes all local unit tests compiling in es5, es6 and esnext. It also works fine on a couple of online javascript compilers I tested (codepen, Typescript playground) - and its exact copy of code others have used for doing the same thing.
If I run this code on the bangle emulator or the bangle2 watch directly I get "NaN" returned.
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.
I have added a round function to my code libs to round numbers to a certain number of decimals. It looks roughly as follows;
expected outcome:
This passes all local unit tests compiling in es5, es6 and esnext. It also works fine on a couple of online javascript compilers I tested (codepen, Typescript playground) - and its exact copy of code others have used for doing the same thing.
If I run this code on the bangle emulator or the bangle2 watch directly I get "NaN" returned.