Zeroes reported as 0.0e+00
gvelasq opened this issue · comments
The new number formatting system is causing some zeroes to be reported as 0.0e+00
.
> tab(mtcars, gear, vs, am)
gear │ vs │ am │ Freq. Percent Cum.
─────────┼──────────┼──────────┼────────────────────────────
3 │ 0.0e+00 │ 0.0e+00 │ 12 37.50 37.50
3 │ 1 │ 0.0e+00 │ 3 9.38 46.88
---------┼----------┼----------┼----------------------------
4 │ 0.0e+00 │ 1 │ 2 6.25 53.12
4 │ 1 │ 0.0e+00 │ 4 12.50 65.62
4 │ 1 │ 1 │ 6 18.75 84.38
---------┼----------┼----------┼----------------------------
5 │ 0.0e+00 │ 1 │ 4 12.50 96.88
5 │ 1 │ 1 │ 1 3.12 100.00
> sum_up(mtcars, gear, vs, am)
Variable │ Obs Missing Mean StdDev Min Max
─────────┼───────────────────────────────────────────────────────
am │ 32 0 0.40625 0.49899 0.0e+00 1
gear │ 32 0 3.6875 0.7378 3 5
vs │ 32 0 0.4375 0.50402 0.0e+00 1
thanks. solved by 8115649
Just to expand a little bit on the current formatting system, the function format_fixedwidth_number(x, w)
is supposed to mimic di %w.0g x
in stata.