Skip to content

PGML algebra mode doesn't respect number display format set in the Context #810

Open
@dlglin

Description

@dlglin

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions