kuinameplates2 icon indicating copy to clipboard operation
kuinameplates2 copied to clipboard

%HP with Decimal Numbers

Open Kueckling opened this issue 3 years ago • 2 comments

Hi,

is there a way to Set enemy HP shown as % with Decimal numbers? like 55.1% instead of only showing 55%?

Thanks

Kueckling avatar Jun 21 '21 16:06 Kueckling

This is my biggest complaint about kui...

PLEASE, can we get this as a feature????

Cobble4 avatar Aug 12 '21 00:08 Cobble4

Hey!

Not sure if this is still relevant but I played around with the codebase a bit and changed following file: Kui_Nameplates_Core/create.lua. In there is a function called: HealthDisplay_Percent. I changed the function to have following code:

    local function HealthDisplay_Percent(s)
        return format('%.2f',s.health_per)..HEALTH_TEXT_PERCENT_SYMBOL
    end

This will then change the Nameplate to always show two decimals (if you only wanna have 99.1 then change the %.2f to %.1f ) instead of only formatting it with decimals when the target has less than 1%.

Not sure if this somehow breaks anything else or consumes more CPU 🤷🏻

lauersimon avatar Nov 21 '21 22:11 lauersimon