BPM finder, implemented in a button

  1. How to convert to BPM?
  2. 1 Minute = 60 seconds = 60,000 ms.
  3. We can divide that by our interval to get BPM
  4. Sadly we get a really long number with a misleading amount of precision.
  5. Apart from manually clamping, is there a way to protect the significant digits?
  6. Answer: javascript numbers have a built in "toPrecision()" that does what we need,
  7. apart from returning a string for some weird reason.