globalizejs / globalize

A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data
https://globalizejs.com
MIT License
4.8k stars 605 forks source link

Globalize date formatter prints quotes around string literals when using short formats #946

Open danielt998 opened 6 months ago

danielt998 commented 6 months ago

When running the following

var Globalize = require( "globalize" );
Globalize.load( require( "cldr-data" ).entireSupplemental() );
Globalize.load( require( "cldr-data" ).entireMainFor( "en", "es", "bg" ) );
console.log("Globalize curr with formatCurrency:" + Globalize("bg").formatCurrency(11231241223, "BGN", {
   compact: "short"
}));

console.log("Globalize curr with currencyFormatter:" + Globalize("bg").currencyFormatter("BGN", {
     compact: "short"
})(11231241223)); 

we get:

Globalize curr with formatCurrency:11 млрд'.' лв.
Globalize curr with currencyFormatter:11 млрд'.' лв.

I believe this is incorrect, and that the single quotes should not be there

The data is coming, I believe, from here