Skip to content

formatNumber - memoizing and getting the parsed pattern #231

@ragulka

Description

@ragulka

First: formatNumber uses numberFormatProperties for parsing the pattern into usable properties. However, it seems that the results of parsing are not memoized - which means that the parsing happens every time a number is formatted. This is not optimal as it makes no sense re-parse the same pattern over and over again.

Second: it seems there is currently no way of getting the results of the parsed pattern, ie properties. I am building an application, where the results could prove quite useful - I want to use it in conjunction with the jquery autoNumeric plugin (scroll down for settings) which expects information about the number format as "properties" instead of a string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions