Significant digits of a number are the digits which contribute to its accuracy - generally these are all digits except leading and trailing zeros. For a more precise definition please see WolframMathworld.
'Returns double with n most significant digits of d.
3
'09-Nov-2019 by www.sulprobil.com PB V1.00
4
sbNSig = Format(d, "." & String(n, "0") & "E+0")
5
End Function
Copied!
Klaus K. offered another worksheet formula for this on the (retired) web site www.Excelformeln.de:
=ROUND(A1,A2-1-INT(LOG(ABS(A1))))
A related function is sbNum2Str which returns a non-scientific string representation of a given number with all significant digits and all leading and trailing zeros.