Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
153 stars 7 forks source link

AbbreviateNumber incorrect on East Asian clients (TW/CN/KR) #515

Open InfusOnWoW opened 6 months ago

InfusOnWoW commented 6 months ago

In all these cultures, instead of the western "thousands", "millions" counting, there are words for 10.000 and 10.000^2, that is 100.000.000, e.g. https://en.wikipedia.org/wiki/Korean_numerals#Cardinal_numerals shows that 만 is 10.000, and 억 is 100.000.000.

Abbreviate Number uses NUMBER_ABBREVIATION_DATA to abstract away these localization issue. The data in NUMBER_ABBREVIATION_DATA is incorrect on all 3 locales.

This if for example from the KR client (with comments and thousand separators added.) The same issue exist for both the simplified and traditional chinese data.

NUMBER_ABBREVIATION_DATA={
  [1]={
    breakpoint=1.000.000.000,  -- Should be 100.000.000
    significandDivisor=10.000.000, -- Should be 100.000.000
    abbreviation="억",
    fractionDivisor=1
  },
  [2]={
    breakpoint=10.000.000,
    significandDivisor=1.000.000, -- Should be 10.000.000
    abbreviation="억",
    fractionDivisor=10
  },
  [3]={
    breakpoint=10.000,
    significandDivisor=1.000,
    abbreviation="만",
    fractionDivisor=10
  }
}

Note that the data structure is commented in UIParent.lua with: -- (significandDivisor and fractionDivisor should multiply to be equal to breakpoint) which is also wrong.

Instead deducing the logic from the western tables: significantDivisor * fractionDivisor should equal to a special word (thousands/millions/만 or억 )

And breakpoints should be:

InfusOnWoW commented 6 months ago

The consequence of the incorrct data is that all values >= 10.000.000 are formatted incorrectly.