Run details:
Mozilla/5.0 (Linux; Android 10; ONEPLUS A6010) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36
Chrome Mobile 85
Android
Mobile
4 years ago
Test name Executions per second
Round floating number using lodash round function 469.7 Ops/sec
Round floating number using toFixed() 2065.8 Ops/sec
Round floating number using toFixed() and parseFloat 1089.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Round floating number using lodash round function

  • Round floating number using toFixed()

  • Round floating number using toFixed() and parseFloat