number_separators.gd 415 B

123456789101112
  1. func test():
  2. # `_` can be used as a separator for numbers in GDScript.
  3. # It can be placed anywhere in the number, except at the beginning.
  4. # Currently, GDScript in the `master` branch only allows using one separator
  5. # per number.
  6. # Results are assigned to variables to avoid warnings.
  7. var __ = 1_23
  8. __ = 123_ # Trailing number separators are OK.
  9. __ = 12_3
  10. __ = 123_456
  11. __ = 0x1234_5678
  12. __ = 0b1001_0101