Tag Info

New answers tagged

1

Likely some duplication with existing answers but I felt like playing with this one. I'll use Format so that the underlying representation does not change. a_ ± b_ ± c_ := PlusMinus[a, b, c]; Format[b_?NumericQ ± err_?NumericQ ± acc_Integer: 6] ^:= Row[{ "(", NumberForm[Row[{b, err}*10^-#, "±"], {acc, acc}, ExponentFunction -> (Null ...


5

Here is my take on this problem. errorForm[num_, err_, digits_] := Module[{exp, n, e}, exp = Floor @ Log10 @ num; n = NumberForm[num/10^exp, digits, ExponentFunction -> (Null &)]; e = NumberForm[err/10^exp, digits, ExponentFunction -> (Null &)]; Row[{ "(", n, "\[ThinSpace]\[PlusMinus]\[ThinSpace]", e, ") ...


0

Ugly, but seems close to what you seek: myTidyForm[a_Real, b_Real] := ( {"(" ~~ ToString[#[[1, 1]]] ~~ "\[PlusMinus]" ~~ ToString[#[[2, 1]] 10^(#[[2, 2]] - #[[1, 2]])] ~~ ")\[Times]" ~~ ToString[10]^ToString[#[[1, 2]]]} &@(MantissaExponent /@ {a, b}))[[1]]


7

PlusMinus[{x_, err_}] := Module[{errE = Last@MantissaExponent[err], xE = Last@MantissaExponent[x]}, Row[{"(", NumberForm[N@Round[x, 10^(errE - 1)]*10^(-xE + 1), {xE - errE + 1, xE - errE}], " \[PlusMinus] ", NumberForm[N@Round[err, 10^(errE - 1)]*10^(-xE + 1), {1, xE - errE}, ExponentFunction -> (Null &)], ")", " ...


1

This seems to be close to what is wanted. a1 = 0.02112398; a2 = 0.000331; f[z1_, z2_] := Module[{t, ee = Floor[Log10[Abs[z1]]]}, t = NumberForm[z1 10^-ee, 3] ± NumberForm[z2 10^-ee, 3 + ee, ExponentFunction -> (Null &)]; t RawBoxes[SuperscriptBox[10, ee]]] f[a1, a2] $$ (2.11 \pm 0.03) 10^{-2} $$



Top 50 recent answers are included