• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Making long numbers/integers easer to read

Status
Not open for further replies.
Level 10
Joined
Apr 3, 2006
Messages
535
Okay so I am trying to make a quick Damage meter system and when I run into some large numbers after a long fight etc the wall of text becomes fairly unfriendly. IS there a way to add in commars or anything to break the line of numbers up so it doesn’t look like 3983958359 Damage, instead something like 1,020,384 Damage.

Hopefully this makes sense.
 
Hello again :D

Well, I really liked the idea and I just wanted to create it xD (I have that sometimes... if it involves some good plain old thinking, I like to do it).
This is what I found:

  • Actions
    • Set StringLength = (Length of (String(Integer)))
    • Set String = <Empty String>
    • For each (Integer LoopInt) from 1 to (Length of (String(Integer))), do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • LoopInt Equal to 4
                • LoopInt Equal to 7
                • LoopInt Equal to 10
          • Then - Actions
            • Set String = ((Substring((String(Integer)), StringLength, StringLength)) + (, + String))
          • Else - Actions
            • Set String = ((Substring((String(Integer)), StringLength, StringLength)) + String)
        • Set StringLength = (StringLength - 1)
    • Game - Display to (All players) for 1.00 seconds the text: String
That should do it, works for me at least...
It shows 100000000 as 100,000,000.
(the second one is a lot easier to read obviously xD)

Edit: Ohh, right: you should probably set Integer to "Damage Taken", converted from a real.
 
Status
Not open for further replies.
Top