-
Notifications
You must be signed in to change notification settings - Fork 0
significantDigits
Subhajit Sahu edited this page Aug 9, 2022
·
3 revisions
Count the number of significant digits in a number.
function significantDigits(x)
// x: a number
const xnumber = require('extra-number');
xnumber.significantDigits(0.0034);
// → 2
xnumber.significantDigits(120.5e50);
// → 4
xnumber.significantDigits(120.5e-50);
// → 4