Skip to content

displayable.toDisplayString: number formatting for primitives #225

@s-leroux

Description

@s-leroux

toDisplayString falls back to String(obj) for primitives; no way to apply alignment/number format like object branch.

Location: src/displayable.mts:103

Code:

// XXX Shouldn't we allow number formatting specifiers?
return String(obj);

Possible approach: Plumb DisplayOptions (or a narrowed number format) into the primitive path, reusing the same mini-language as format() / amount formatters where appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request, add new capabilityqualityCross-cutting polish; eventually pair with another work-type label

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions