significant digits

B

Bernd P

Hi Ron,

Thanks. You are right.

This should do the trick:
Function nsig(d As Double, l As Long) As Double
'Returns double with l most significant digits of d.
Dim s As String

s = "0." & String(l - 1, "0") & "E+0"
nsig = Format(d, s)
End Function

Regards,
Bernd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top