Thread: Stuf LUA help
View Single Post
11-06-17, 02:59 PM   #6
hikokun
A Murloc Raider
 
hikokun's Avatar
Join Date: Oct 2015
Posts: 4
Long ago I had figured out a solution but I've now lost it and I'm looking for it again --

The above solution only shortens it as so -

60.00% | 3000K / 5000K

I would prefer it to start shortening at 1000000 as so -

60.00% | 3.0M / 5.0M
5.00% | 250000 / 5.0M

Thanks for any help!

Edit:
Lua Code:
  1. function(unit, cache, textframe)
  2.             local curhp, maxhp
  3.             if UnitExists(unit) then
  4.                 curhp = UnitHealth(unit)
  5.                 maxhp = UnitHealthMax(unit)
  6.             else
  7.                 curhp = UnitHealth("player")
  8.                 maxhp = UnitHealthMax("player")
  9.             end
  10.             local perchp = 100 * curhp/maxhp
  11.             local stamp = "%.2f%%".." | "..curhp.." / "..maxhp
  12.             return stamp,perchp
  13.         end

Current code I'm using.

Last edited by hikokun : 11-06-17 at 03:09 PM.
  Reply With Quote