Skip to content

Range with NaN, Infinity #12

Closed
Closed
@sffc

Description

@sffc

I think we should probably forbid NaN and Infinity from taking part in a number range format. What would be your expected behavior in these cases?

new Intl.NumberFormat().formatRange(10, NaN);
new Intl.NumberFormat().formatRange(10, Infinity);

The first case makes no sense. The second case could be an interesting application of the "greater than" pattern, but that's not yet supported in ICU.

For now, better to throw a RangeError. We can remove that restriction later if we ever needed to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    has-consensusHas consensus and ready to implement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions