No Decimal Places #1392


  • Replied
  • Question
Closed
  • bobthegoat2 created this issue Mar 9, 2017

    Hi, im the guy who made the Boomkin rotation helper with no LUA.

     

    I was hoping you could help me do a small amount of cleaning.

     

    I need to display the "duration" of an icon in another icon.

     

    My source icon displays its "duration" with no minutes and no decimal places as default like this

    11

    10

    9

    8

    etc

    The "duration" is how long is remaining on a buff.

    (I use OmniCC with "never show decimal places" if that helps)

     

    When I use your DogTags to display the source icons duration in other icon

    [Duration(icon="TMW:icon:1Om2mpPsDX2m")

    TMWFormatDuration
    FormatDuration

    I get results that don't display the duration in the same format as the source icon (no minutes and no decimal places)

    I always end up with minutes and seconds or one decimal place such as:

    1:01

    1:00

    0:09

    or

    1.6

    1.5

    1.4

     

    I have tried formatting using custom code I found on the internet which almost gets what I want.

    For Example

      [Duration(icon="TMW:icon:1Om2mpPsDX2m"):FormatDuration("function round(num, numDecimalPlaces)\n  local mult = 10^(numDecimalPlaces or 0)\n  return math.floor(num * mult + 0.5) / mult\nend")]

    But this puts an "s" at the end of my seconds like this:

    9s

    8s

    7s

    6s

     

    Is there any way that I can get my icon to check the duration of the source icon and display the duration exactly as the source icon does with no minutes, no decimal places, and no "s" at the end?

     

    Thanks!

     

    PS: I'm not a programmer and as you can see I have put in my best effort to make this work rather than bother you :D

  • bobthegoat2 added a tag Question Mar 9, 2017
  • bobthegoat2 edited description Mar 9, 2017
  • bobthegoat2 edited description Mar 9, 2017
  • bobthegoat2 edited description Mar 9, 2017
  • bobthegoat2 edited description Mar 9, 2017
  • Cybeloras closed issue Mar 21, 2017
  • Cybeloras posted a comment Mar 21, 2017

    [Duration(icon="TMW:icon:1Om2mpPsDX2m"):Round]

  • Cybeloras added a tag Replied Mar 21, 2017
  • bobthegoat2 posted a comment Mar 23, 2017

    HAH.

     

    So simple. I tried that using FormatDuration and TMWFormatDuration but never thought to try it like that.

     

    Thanks ;)


To post a comment, please login or register a new account.