Open
Description
Algebra mode in PGML seems to be hard-coded to use "%g" as the display format for numbers, which leads to some counterintuitive behaviour with MathObjects, particularly when a custom number format is set in the context.
Consider the following MWE:
DOCUMENT();
loadMacros("PGstandard.pl","MathObjects.pl","PGML.pl");
Context()->{format}{number} = "%d";
$x = Real(1234567);
BEGIN_PGML
[`[$x]`]
[:[$x]:]
END_PGML
ENDDOCUMENT();
In LaTeX mode it displays 1234567, but in algebra mode it converts to scientific notation. This doesn't seem like the desired behaviour if the author has explicitly set a number format for the MathObject.
Does it make sense to have PGML inherit the number format from the context? Is that even possible?