• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
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