There is a bug with format() as redefined in m-graph.mkiv 1e10 and 1e-10 truncate the tailing 0.
The function strip() is removing 0 throughout the exponent, and I
don't know what purpose that might serve. If we never want to remove
zeroes, this works:
local function strip(s)
- return "\\times10^{"..(s:gsub("%+*0*","")).."}"
+ return "\\times10^{"..(s:gsub("%+*","")).."}"
end
Note that if the exponent is zero the "× 10^0" will be left out
completely, in both the old and the new strip() function. This seems
to be by design. Illustration of this behaviour:
\usemodule[graph]
\starttext
\startMPpage
label(format("@g","1e+0"),(2cm,-1cm)) ;
\stopMPpage
\stoptext
Cheers,
Sietse
On Mon, Oct 15, 2012 at 11:19 AM, Alan BRASLAU
There is a bug with format() as redefined in m-graph.mkiv 1e10 and 1e-10 truncate the tailing 0. (I have not been able to fix the code...)
Alan
Minimal example:
\usemodule [graph]
\starttext \startMPpage label(format("@g","1e-10"),(0, 0)) ; label(format("@g","1e+10"),(2cm, 0)) ; label(format("@g","1e-12"),(0, -.5cm)) ; label(format("@g","1e+12"),(2cm,-.5cm)) ; \stopMPpage \stoptext ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________