Removing Decimals in multiboards

WorpeX

New Member
Reaction score
8
Ok, I have a quick question about decimal values in multiboards. I want to display a countdown timer in my board, this is the trigger i'm using:

Code:
Multiboard - Set the text for MatchBoard item in column 3, row 5 to (String((Remaining time for Timer), 3, 0))

The problem I am having is that when it is in the actual game, it displays as something like: 54.0 instead of just 54. When I set the trigger to a non-formatted string is makes the values 54.000.

I want to get rid of these stupid decimals, how can I do this?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Use the GUI Maths function Abs:
Trigger:
  • Set TempString = (String((Abs((Remaining time for Timer)))))


This gives the absolute value of the time, which is only in whole numbers :D
 

GooS

Azrael
Reaction score
154
No idea what Abs in GUI actually does as I don't have WE open, however a simple Real to integer conversion would have worked aswell.

*opening WE*

hmm, I wonder why Abs returns the number in integer form when the return is real.

JASS:
function RAbsBJ takes real a returns real
    if (a >= 0) then
        return a
    else
        return -a
    endif
endfunction


Anyone? is it becuase of the 'integer' comparisson?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top