Skip to content

Support for other Currency Codes when using different locale #7

@bvkimball

Description

@bvkimball

The following don't work when not in the same locale as the currency.

abbrev full symbol
PLN Polish Zloty
CHF Swiss Franc CHF
AED United Arab Emirates Dirham AED
SGD Singapore Dollar $, S$
HUF Hungarian Forint Ft
DKK Danish Krone kr.
SEK Swedish Krona kr
NOK Norwegian Krone kr
ZAR South African Rand R

The issue is with then INTL libary only seems to support true currency symbols (ie. single character) from here:
http://www.fileformat.info/info/unicode/category/Sc/list.htm

Spec: http://www.ecma-international.org/ecma-402/1.0/#sec-6.3

We should create an override system for these scenarios to check if the currency code (PLN) is still in the formatted string replace with overrideString in a mapping we maintain.

Override should happen here: https://github.com/bullhorn/chomsky/blob/master/src/lib/formats.ts#L53

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions