[#1] Winners of Skript Challenge - Number Format

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

BaeFell

I'm Poppy
Staff member
Admin
skUnity Legend
Nov 27, 2016
1,022
241
73
discord.gg
Discord Username
BaeFell
Hi everyone,

After remembering it's Monday and that I hadn't posted the winners of the first Skript Challenge, I've just done it now. Woo! :emoji_grinning:

I've slightly changed the judgement, because there were a variety of answers and like, only 2 people followed the exact rules :emoji_rolling_eyes:.

In first place is @it_twit with the shortest length:
Code:
regex replace "(?<=\d)(?=(\d{3})+(?!\d))" with "," in {_integer}

In second place is @Snow-Pyon with the code that got @it_twit first:
Code:
regex replace "(?<=\d)(?=(\d\d\d)+(?!\d))" with "," in {_integer}

In third place is @Sylfare with code that doesn't require any addons but is compact:
Code:
set {_r} to "%{_number}%"
set {_t} to ""
loop round up length of {_r} / 3 times:
    set {_l} to the last 3 characters of {_r}
    set {_r} to the first length of {_r} - 3 characters of {_r}
    if loop-number = 1:
        set {_t} to "%{_l}%%{_t}%"
    else:
        set {_t} to "%{_l}%,%{_t}%"

There is currently no prizes, but @xXAndrew28Xx might have a prize, apparently. I'm looking at getting some sort of medal system or something to reward people.

Hope you all enjoyed this Skript challenge! If you have an idea for the next one, PM me and I'll see what I can do.

Thanks,
BaeFell
 
  • Like
Reactions: Sam