bltseattle
Civil/Environmental
- Sep 18, 2002
- 347
I've come up with an Excel formula that will round a number to a user specified number of significant digits, as follows:
=ROUND(number,-(INT(LOG(number)+1-num_digits)))
Can someone please help me to code this into a user defined VBA function?
Such as Sigfig(number, num_digits)
I've tried but cannot get it to work as a user-defined function, but it seems it should be straightforward. I have limited VBA skills.
Thanks!
=ROUND(number,-(INT(LOG(number)+1-num_digits)))
Can someone please help me to code this into a user defined VBA function?
Such as Sigfig(number, num_digits)
I've tried but cannot get it to work as a user-defined function, but it seems it should be straightforward. I have limited VBA skills.
Thanks!