1. #1
    Deleted

    Weakaura's show numbers in million's instead of thousands :)

    Hey guys, as the thread says i've been trying to figure out how to change the numbers on my mana bar that i made in WA into Millions instead of thousands.
    I'd love it if it could say 1.10M as that is my mana. As of now my mana bar that i made in WA says 1100k and i'd like it to show 900k when i reach 900k mana and so on and go into millions when it reaches 1m etc.

    I'd love to link pictures/links but i can't until i post a few times. So i'll just post the function i use that i took off an older post on this site.

    ----------------------

    Code:
    function()
        return ("%.0fk"):format(UnitMana("player") / 1000, UnitManaMax("player") / 1000)
    end
    ----------------------





    Thanks in advance guys
    Last edited by mmoc5031843fa4; 2017-10-01 at 03:19 PM.

  2. #2
    If you want to include your max, for example "900k / 1.10m", use the first one. If you just want your current, use the second one. I have taken the liberty of making it so that if mana is under 10k, the full number displays, such as 9999. Not really necessary at 110, but relevant if you happen to use this weakaura on a low alt.

    For all numbers displays on either, you'll see 1-9999, 10k-900k, and 0.90m and above.


    Code:
    function()
    	local current,max=UnitMana('player'),UnitManaMax('player')
    	if current<10000 then
    		-- do nothing
    	elseif current<900001 then
    		current=("%.0fk"):format(current/1000)
    	else
    		current=("%.2fm"):format(current/1000000)
    	end
    	if max<10000 then
    		-- do nothing
    	elseif max<900001 then
    		max=("%.0fk"):format(max/1000)
    	else
    		max=("%.2fm"):format(max/1000000)
    	end
    	return tostring(current).." / "..tostring(max)
    end
    Code:
    function()
    	local current=UnitMana('player')
    	if current<10000 then
    		-- do nothing
    	elseif current<900001 then
    		current=("%.0fk"):format(current/1000)
    	else
    		current=("%.2fm"):format(current/1000000)
    	end
    	return current
    end
    Last edited by Kanegasi; 2017-10-01 at 04:42 PM.
    Originally Posted by Zarhym (Blue Tracker)
    this thread is a waste of internet

  3. #3
    Deleted
    Quote Originally Posted by Kanegasi View Post
    If you want to include your max, for example "900k / 1.10m", use the first one. If you just want your current, use the second one. I have taken the liberty of making it so that if mana is under 10k, the full number displays, such as 9999. Not really necessary at 110, but relevant if you happen to use this weakaura on a low alt.

    For all numbers displays on either, you'll see 1-9999, 10k-900k, and 0.90m and above.


    Code:
    function()
    	local current,max=UnitMana('player'),UnitManaMax('player')
    	if current<10000 then
    		-- do nothing
    	elseif current<900001 then
    		current=("%.0fk"):format(current/1000)
    	else
    		current=("%.2fm"):format(current/1000000)
    	end
    	if max<10000 then
    		-- do nothing
    	elseif max<900001 then
    		max=("%.0fk"):format(max/1000)
    	else
    		max=("%.2fm"):format(max/1000000)
    	end
    	return tostring(current).." / "..tostring(max)
    end
    Code:
    function()
    	local current=UnitMana('player')
    	if current<10000 then
    		-- do nothing
    	elseif current<900001 then
    		current=("%.0fk"):format(current/1000)
    	else
    		current=("%.2fm"):format(current/1000000)
    	end
    	return current
    end
    You are a GOD!

    Thanks a bunch mate

  4. #4
    Wouldn't it be easier for you to just use %mana?

Posting Permissions

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