Feature Request #52


Open
Assigned to usoltsev
  • 偶尔不呼吸 created this issue Feb 12, 2019

    I love this great addon very much. Thanks for your working.

     

    I noticed that it supported Chinese. Anyway, Chinese are used to using “万” and “亿” in shortening numbers.
    I was wondering if you can add an option for it. Thanks again!

     

    1. number > 100 000 000, we use "亿"("億" for zhTW).
    example: 1000 000 000→10亿

    2. number > 10 000, we use "万"("萬" for zhTW).
    example: 10 000 000→1000万

  • usoltsev posted a comment Feb 28, 2019

    Hi!

     

    Thank you for response.

     

    You can use them. Just set "Custom format" in "Format of hp" and change "abbreviation".

    More details in https://wow.curseforge.com/projects/easy-frames#title-4

     

    I hope this helps.


    Edited Feb 28, 2019
  • usoltsev self-assigned this issue Feb 28, 2019
  • 偶尔不呼吸 posted a comment Feb 28, 2019

     Thanks for your reply.

     

    I set like this:

    "Custom format"

    "Value greater than 100 000":%.2f万

     

    Value: 123 456

    It displayed “123.46万” on the frames.

    However, the correct display is “12.35万”, because "1万"=10 000 and "1亿"=100 000 000 in Chinese.

     

    Here is lines of code from an addon which shortens the numbers for Skada(Written by a Chinese WoWer), I hope it's useful for you.

     

    local function Event(event, handler)
        if _G.event == nil then
            _G.event = CreateFrame("Frame")
            _G.event.handler = {}
            _G.event.OnEvent = function(frame, event, ...)
                for key, handler in pairs(_G.event.handler[event]) do
                    handler(...)
                end
            end
            _G.event:SetScript("OnEvent", _G.event.OnEvent)
        end
        if _G.event.handler[event] == nil then
            _G.event.handler[event] = {}
            _G.event:RegisterEvent(event)
        end
        table.insert(_G.event.handler[event], handler)
    end
    
    local function HookFormatNumber()
    if Skada == nil then return end
        Skada.FormatNumber = function(self, number)
            if number then
                if number > 100000000 then
                    return ("%02.2f亿"):format(number / 100000000)
    			elseif number > 100000 then
    				return ("%.1f万"):format(number / 10000)
    			elseif number > 10000 then
    				return ("%.2f万"):format(number / 10000)
    			else
    				return ("%d"):format(number)
    			end
            end
        end
    end
    
    Event("PLAYER_ENTERING_WORLD", function()
        HookFormatNumber()
    end)

     


    Edited Feb 28, 2019
  • usoltsev posted a comment Mar 7, 2019

    Now I get it!


    Unfortunately you can't do this. At least not in this version.

    I'm sorry.

  • 偶尔不呼吸 posted a comment Mar 7, 2019

    Lots of my friends(Chinese) love this great addon very much.

     

    We all look forward to this feature.


    Edited Mar 8, 2019
  • usoltsev posted a comment Mar 9, 2019

    Very nice to hear that :)
    I will try to make the setting for the number format for Chinese users in the next version.

  • 偶尔不呼吸 posted a comment Mar 10, 2019

    You are so nice!

     

    BTW,There are Player/Target/Focus/Pet Frames in “Easy Frames”. Why not Boss frames? (I want to change the scale of Boss frames.)

  • justrandguy posted a comment Mar 11, 2019

    That´´'s actually a great ideia about the boss frames.

  • usoltsev posted a comment Mar 13, 2019

    The boss frames are scheduled.


To post a comment, please login or register a new account.