Let's say that I want to display the
following numbers using 5 significant digits.
0.0000123456789 should be displayed as 0.000012346.
Here's how to do this:
x:=0.00000012345678912345678;
nsigfigs := 5;
new_x := rsubst(format('%s', format('%20.20f', bin(x, power(10, floor(log10(x)) - (nsigfigs-1))))), '0*\\\$', '', 'sg');
following numbers using 5 significant digits.
0.0000123456789 should be displayed as 0.000012346.
Here's how to do this:
x:=0.00000012345678912345678;
nsigfigs := 5;
new_x := rsubst(format('%s', format('%20.20f', bin(x, power(10, floor(log10(x)) - (nsigfigs-1))))), '0*\\\$', '', 'sg');
