Skip to content

The currency symbol/code is not always properly spaced #65

Description

@bojanz

We currently rely on the pattern to give us the complete layout of the final number.
But CLDR has additional rules that say when a space should be inserted around a currency symbol/code, which look like this:

"currencySpacing": {
            "beforeCurrency": {
              "currencyMatch": "[:^S:]",
              "surroundingMatch": "[:digit:]",
              "insertBetween": " "
            },
            "afterCurrency": {
              "currencyMatch": "[:^S:]",
              "surroundingMatch": "[:digit:]",
              "insertBetween": " "
            }
          },

Yes, that's quite confusing, which is why I missed it previously.

Looks like this is a good opportunity to check how our formatting logic compares with the ICU4J one.

Relevant links:
angular/angular#20708
andyearnshaw/Intl.js#221

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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