Skript Challenge #1
Number Format
Some of you might remember when we've done Skript Challenges before. They were quite fun and showed a different end of the community as people came to show their little tricks of Skript. Skript is a quirky language in that sometimes the logic you put in is not what Skript actually does. This is what makes Skript Challenges so fun!Number Format
Anyways! I'm going to try and do one every now and then, hopefully at least a fortnight apart but sometimes might be weekly. There won't be any set schedule for when I do them, but just keep an eye on this forum section! If you have an idea for a Skript Challenge, please PM me with it and a bit of info on it.
This Skript Challenge is a number format one! Basically, you must be able to change any length of number into a formatted number so like changing 245863 -> 245,863, 17354682 -> 17,354,682. You can use either "," or ".", depending on what's used locally (even though using "." is wrong lol).
The rules are as follows (note: rules may change between challenge):
- Your code must be in [code]<code>[/code] tags so that I can easily read it.
- You can use addons, but, you're not allowed to use a feature from an addon which does this (don't think any do) and the addon must of been released publicly prior to the creation of this thread. So not, you cannot use a feature like format {_integer} using "," or whatever.
- You can use another user's code, but please don't edit your messages. I can see all message history.
Challenge details (specifics about this challenge):
- The integer you must format is in a variable called "{_integer}".
- Your code must accept any length of integer and support integers that are less than 3 in length (so like 512).
- You do not have to message it back to the player
How answers will be judged:
The winner will be selected by having the shortest answer. Whitespace won't be added on (so spaces/tabs). Lines count isn't counted either. Just the number of characters. I'll be using http://www.charactercountonline.com/ to judge all answers. Any questions, just ask.
Just encase you're wondering, I have made this by myself before, and it not only supported any length of integer, but also would automatically pick up the currency sign and if there was a cents part of it. It was for formatting a players balance like $123,456.78.
Have fun! The closing date is a few days or something. Idk.