1. #1

    Weak Auras, abbreviate to thousands

    Hey guys,

    I'm trying to make what I thought was a very simple little aura. It should simply show my health as text, similar to this:

    250K/300K (or however much health I have)

    The problem is that little K at the end. I CAN NOT find how to abbreviate the numbers in Weak Auras. I even tried making my own custom LUA function, using snippets I found online, but couldn't get that to work either.

    Anyone know how to do this?

    Thanks

  2. #2
    Custom Text (%c):

    Code:
    function()
        return ("%.0fk / %.0fk"):format(UnitHealth("player") / 1000, UnitHealthMax("player") / 1000)
    end
    If you want decimals (250.4k / 300.9k, for example) just use %.01fk in both places (1 being the number of decimals)
    Last edited by ccKep; 2013-02-17 at 12:40 AM.

  3. #3
    Thanks mate! Worked great!
    Strange this is not a built in feature in Weak Auras normal settings though, would have made it easier for people

    In any case, thanks allot!

  4. #4

    Weak Aura Abbreviated HP?

    I may be taking crazy pills here.. but I am trying to find the abbreviation for weakauras to show me the health abbreviation (for k and m) without the /482k or whatever at the end. What would be the code for that. For the life of me, I cannot find it anywhere on the internet as it appears I am the only one who doesn't want this blank out of blank format... can anyone help me?

    So for instance, I would want 432,039 to show up as 432k.
    I would want 43,938,244 to show up as 43m.

    Also, Is it possible to have the top text as a custom text and the bottom text as a different custom text? If so, where is the other box?
    Last edited by silvercued; 2013-10-22 at 05:51 PM.

  5. #5
    Quote Originally Posted by silvercued View Post
    So for instance, I would want 432,039 to show up as 432k.
    I would want 43,938,244 to show up as 43m.
    Assuming you're talking about target hp:
    Code:
    function()
        local health = UnitHealth("target")
        local abbr = ""
        if health >= 1000 then
            health = health / 1000
            abbr = "k"
        end
        if health >= 1000 then
            health = health / 1000
            abbr = "m"
        end
        
        return ("%.0f%s"):format(health, abbr)
    end

  6. #6
    High Overlord GoKs's Avatar
    Join Date
    May 2013
    Location
    South Africa
    Posts
    196
    Since we are on the topic of health and WA2 here, I would appreciate it if someone could tell me how to add a bar to show how much % of health my target has?
    I am a hunter and I use this WA2 mod : http://www.mmo-champion.com/threads/...ter-Aura-Group!. It is really great, just missing a bar for the health %, it would even help if the % of HP is displayed on the focusbar (like JSHB).?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •