transloco icon indicating copy to clipboard operation
transloco copied to clipboard

Feature: getLocaleNumberSymbol API for CurrencyDecimal etc

Open KirstenStake opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe.

I need to know the decimal symbol of a locale (for example: en-GB uses . and pt-BR uses , ) According to your docs you only provide a localizeNumber() function which formats the actual number with the locale's decimal. This is not the required action I need, I need to only know the actual CurrencyDecimal symbol.

Describe the solution you'd like

A function to specify what symbol you would like to get returned based on the locale. In my specific instace "CurrencyDecimal". I previously used this function from angular/core translate which is their getLocaleNumberSymbol() where you can specify what numberSymbol you require.

This is not an unhandled feature since switching to transloco

Current behavior

You only provide a function for localizeNumber() which requires the whole number as a value. I only require the actual symbol to be returned, nothing to do with formatting.

Expected behavior

function like getLocaleNumberSymbol(locale, "currencyDecimal") to return a response of ',' or '.' etc

KirstenStake avatar May 11 '21 06:05 KirstenStake

@KirstenStake seems like a pretty rare requirement, but if you like you can try to implement it and create a pr that adds that ability to our LocaleService.

itayod avatar May 16 '21 07:05 itayod