Open dpsanders opened 8 years ago
Oh, is this the non-implemented g
option? I seem to remember that that was implemented in Julia's @printf
at some point?
julia> @printf("%.6g", pi)
3.14159
julia> @printf("%.6g", 10pi)
31.4159
But since the *
is not supported in @printf
strings, one cannot determine the number of significant digits at runtime (except with the eval
trick), so @printf
is not a replacement for significant=x
.
It would be a great to have this feature. I had this problem with displaying pvalues where I would like to show 4 significant figures over several orders of magnitude.
Is this issue still an issue? There is no longer a format
function.
I have just discovered the
format
function, exactly what I was looking for, thanks!Currently I can only find a
precision
option that fixes the number of decimal places. It would be very useful to have asignificant
option that fixes the number of significant figures instead.E.g.
I would like an option to fix
significant=6
to get3.14159
in the first case, and31.4159
in the second.