Why elixir grows more on me the more I use it

Me casually typing an Ecto validation in VSCode

|> validate_number(:pay, greater_than: 0, less_than: 9999999)

I have auto-formatting enabled on Save… VSCode changes the code into the following

|> validate_number(:pay, greater_than: 0, less_than: 9_999_999)

I go WTH… did I make a typo, why did the formatter do such a thing? I mean it is nicer but… let me search

Numbers

Integers (1234) and floats (123.4) in Elixir are represented as a sequence of digits that may be separated by underscore for readability purposes, such as 1_000_000. Integers never contain a dot (.) in their representation. Floats contain a dot and at least one other digit after the dot. Floats also support the scientific notation, such as 123.4e10 or 123.4E10.

awe, now I like you more :heart:

13 Likes