Calc currently does not have a function that rounds a value to a determined number of significant digits.
Rounding to significant digits is useful for scientific and engineering users as well as for unit tests of functions that return numeric results.
Steps to Reproduce:
User Profile Reset: No
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0
Specification for function SIGDIGITS:
Summary: Rounds the value X to the number of significant digits specified by Digits.
Syntax: ROUND( Number X ; Integer Digits )
Constraints: 0 < Digits
round( X * 10^−n) * 10^n
with n = floor(log10(x)) + 1 − Digits.
Winfried Donkers committed a patch related to this issue.
It has been pushed to "master":
tdf#105931 Add function ROUNDSIG to Calc.
It will be available in 5.4.0.
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.
An unexpected result comes from
Most of the times, the result is -1.3862065601674 (incorrect).
Sometimes it is -1.3862065601673 (correct).
Other ROUNDSIG instances with T.INV and 14 digits don't show this behaviour.
=ROUNDSIG(T.INV(0.15,2),14) consequently returns -1.38620656016734 (correct).
I do not know yet if this is caused by ROUNDSIG() or by something else.
(In reply to Winfried Donkers from comment #3)
> =ROUNDSIG(T.INV(0.15,2),14) consequently returns -1.38620656016734 (correct).
Oops, this should be
=ROUNDSIG(T.INV(0.15,2),15) consequently returns -1.38620656016734 (correct).