mchangrh / sb-slash

Sponsorblock with discord slash commands
https://sb-slash.mchang.workers.dev/invite
GNU General Public License v3.0
7 stars 6 forks source link

Adding Commas! #1

Closed AwesomenessZ closed 3 years ago

AwesomenessZ commented 3 years ago

Using the .toLocaleString("en-US") function, the number value will be converted to a string that contains commas for better readability. An example: var test = 12386234; console.log(test); console.log(test.toLocaleString("en-US")); results in:

12386234 12,386,234

Note: I didn't test this in this specific bot itself because I couldn't easily get it to start, but I tested in in node with my bot and it seems to work fine.

AwesomenessZ commented 3 years ago

Its debatable whether or not you want to have Ignored Submissions, Warnings, and Votes to be parsed as well but I feel like it is very unlikely to have larger numbers and therefore not needed

mchangrh commented 3 years ago

For /showoff they should be parsed, for userinfo they should also be parsed. Having it doesn't hurt.

AwesomenessZ commented 3 years ago

For userinfo, segmentinfo, and showoff its parsed. I only didn't include it in certain categories (Like how many votes a segment has doesn't get parsed because it is unlikely to have above 999, and if it is then its likely just 10k from a vip). I felt that the total number of ignored submissions and warnings were also unlikely to reach 999+