Skip to main content
Participant
May 22, 2023

Wrong thousand separator in num.toLocaleString("de-CH") - should be apostrophe not single quote

  • May 22, 2023
  • 2 replies
  • 1280 views

Hi

 

I noticed with font Monteserrat that the thousand separator in the num.toLocaleString("de-CH") looks wrong. It should look like a little straight line and not a comma. It looks like the single quote is being used instead of the apostrophe. 'The apostrophe exists in the font so I'm sure the problem is with the implementation in AfterEffects. I hope this gets corrected!

 

U+0027 ' APOSTROPHE (')


For reference: https://en.wikipedia.org/wiki/Decimal_separator#:~:text=Switzerland%3A%20There%20are%20two%20cases,%2C%22%20as%20the%20decimal%20separator.

Image: Blue output from expression, number counting up, yellow just static text showing the difference in separator.

This topic has been closed for replies.

2 replies

JohnColombo17100380
Community Manager
Community Manager
May 22, 2023

Hi @jnsdebraekeleer,

Thank you for reporting this issue. This appears to be an issue within the V8 JavaScript engine, the Montserrat typeface itself, or perhaps the glyphs Montserrat assigns within Adobe products.

 

E.g. if I run "(12345).toLocaleString("de-CH")" in the JS Console of Chrome, the return value is '12’345', using the curved single-quote for the thousands-separator rather than the apostrophe. Copying that string into AE or Illustrator also will continue to use the curved single-quote.

 

We will look into addressing this issue within the JavaScript engine, but a workaround, for now, would be to use "replace()" to substitute a straight apostrophe for any curved quotes, as shown in the expression snippet below:

var num = 1000000;
num.toLocaleString("de-CH").replace(/’/g, "'");

 

Thanks again for reporting this issue,

- John, After Effects Engineering Team 

Adobe Employee
May 22, 2023

Extendscript is a very old dialect of javascript and you are using the modern API.

 

It appears you have to set the locale on the $ object, and then everything flows from that.

 

script.do var n = Number(123.56); $.locale ="de"; n.toLocaleString();

Scripting Result - 123,56

 

Douglas Waterfall

After Effects Engineering