1. #1
    Deleted

    Weak Auras and shortening large numbers

    I have recently been revamping all of my Weak Auras, and when I came to my Blood DK I have a Weak Aura setup for my Blood Shield. When I gain a Blood Shield it shows me how large the shield is but it currently uses the default format eg. 175645. I was wondering if it was possible to shorten it to say 176k.

    Thanks.

  2. #2
    if you want the dumb blizzard way without really writing a custom function you can do this for the %c custom text:
    Code:
    function(...)
        local amount=select(7,...)
        return AbbreviateLargeNumbers(tonumber(amount) or 0)
    end

  3. #3
    Blademaster Shifts's Avatar
    10+ Year Old Account
    Join Date
    Jun 2011
    Location
    Milky Way > Earth > Europe > The Netherlands
    Posts
    44
    Perhaps you could try the following for %c custom text.
    I'm using this function on various characters for stuff like that(PW:S, Guard, etc.)

    Hope it works for you too.
    //Shifts

    Code:
    function () 
        local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Blood Shield")
        if(value > 999999) then value = math.floor(value/1000000) .. "M" end
        if(value > 999) then value = math.floor(value/1000) .. "k" end
        return(value)
    end

  4. #4
    Quote Originally Posted by Shifts View Post
    Perhaps you could try the following for %c custom text.
    I'm using this function on various characters for stuff like that(PW:S, Guard, etc.)

    Hope it works for you too.
    //Shifts

    Code:
    function () 
        local name,_,icon,_,_,_,_,_,_,_,_,_,_,_,value=UnitBuff("player", "Blood Shield")
        if(value > 999999) then value = math.floor(value/1000000) .. "M" end
        if(value > 999) then value = math.floor(value/1000) .. "k" end
        return(value)
    end
    Any chance you can make that work for Eternal Flame? i tried just changing "Blood Shield" to "Eternal Flame" but it either came up in errors or just as a 0 value.

  5. #5
    Blademaster Shifts's Avatar
    10+ Year Old Account
    Join Date
    Jun 2011
    Location
    Milky Way > Earth > Europe > The Netherlands
    Posts
    44
    Hello Das,
    I haven't been able to get the function to work with Eternal Flame in the same way it works with Blood Shield as described above. I'm getting just 0's instead of actual numbers as well.

    The one other way I know how to get it to display the amount it heals you for is by setting text to %s and then going to Trigger and enter the SpellID for Eternal flame and then tick the box that says "Use tooltip "size" instead of stacks".
    You can even tick the "Cooldown" tickbox to get the heal amount AND the duration in 1 single Icon without any other complicated functions/code(many people overlook this method of showing both stacks&duration).

    Unless you've tried that already and were just looking to shorten the numbers, in which case I am sorry but my coding knowledge is too limited for that

    //Shifts

    ---edit---
    The function does work for Sacred Shield though. In the same way; enter the SpellID (use 20925) and tick the box for "Use tooltip size instead of stacks" and then use that function as the %c custom text.

    Hope it helps.
    Last edited by Shifts; 2013-09-16 at 11:11 PM.

Posting Permissions

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