Skript

Skript

743k Downloads

Number Formatting

CerialPvP opened this issue ยท 4 comments

commented

Suggestion

Basically, make it so you can specify numbers with underscores.
Example: set {_n} to 10_000, give player 1_024 of barrier

Why?

  1. Most programming languages, such as Python and Java, already have this feature.
  2. For big numbers, it is a pain to write them out and count the length to make sure the number is correct and that we didn't enter a high number.

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.
commented

I think we should prefer commas if possible, e.g. give player 1,024 of barrier. This would break some existing list parsing, e.g. set {_list::*} to 1,100, but that is already confusing code imo

commented

I think that's pretty dangerous, especially with things like functions. It's very common to write location(1,104,188.3) for example

commented

yeah that's fair. it's probably more common than i'm thinking

commented

Also note some European countries use comma to denote decimals (where, for example, the US uses the '.'), adding more to the confusion.

I think this is a no-brainer. Super easy to add and does a lot for readability (the version with the underscore of course).