I’m okay with the other options, it’s just, to me, I can see numbers that
actually have meaning to be split at 3, makes sense. But an ID which is
isn’t meant to be split, at least in my mind, shouldn’t be split every
three characters.

A DB ID is just an ID, not really carrying any significance when counting
other than incrementally telling you which record it is when created.
On Sat, Apr 28, 2018 at 6:37 AM Norbert Melzer <[email protected]> wrote:

> No, he did not write that tests are failing because of this, but that he
> has trouble to search the IDs in his testdata, because on his sheet of
> paper there is written 100000002, and in his testdata it is 100_000_002.
> So instead of simply typing the number he has to think and insert
> underscores at the right places.
>
> 'Justin Wood' via elixir-lang-core <[email protected]>
> schrieb am Fr., 27. Apr. 2018 um 22:07 Uhr:
>
>> Forgive me if I am missing something obvious, but I don't quite
>> understand how the underscores are making your tests fail. The compiler
>> removes them. It is only syntactic sugar for us humans who are bad at
>> parsing long sequences of numbers. Would you be able to provide an
>> example of how these are making your tests fail?
>>
>> iex(1)> 100_000_002 == 100000002
>> true
>> iex(2)> 100_000_002 = 100000002
>> 100000002
>> iex(3)> quote do 100_000_002 end
>> 100000002
>>
>> # This test passes
>> test "underscores in numbers" do
>>   assert 100_000_002 = 100000002
>> end
>>
>> Justin
>>
>>
>> Sent with ProtonMail <https://protonmail.com> Secure Email.
>>
>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>> On 27 April 2018 2:01 PM, Onorio Catenacci <[email protected]> wrote:
>>
>>
>> On Saturday, April 21, 2018 at 4:06:45 AM UTC-4, Allen Wyma wrote:
>>
>>> First of all, I'd like to say thanks so much for the elixir formatter. I
>>> do like nearly all of the defaults. There's one place that I would like to
>>> change:
>>>
>>> formatting of numbers.
>>>
>>> I'd like to be able to turn off the auto formatting of numbers to add in
>>> underscores after every third number.
>>>
>>> Reason:
>>> I do have some test data in my elixir files that I use to check
>>> information and when I search for certain test data by ID, which is a long
>>> number, it won't be found cause of the underscores added to the number.
>>>
>>> I can see this being useful if you're working with currency, or numbers
>>> with some meaning of counting; it does make the numbers easier to read, but
>>> if you're reading like an ID, then it becomes a big difficult to understand.
>>>
>>> %{ "specialId" => 100000002 } # => %{ "specialId" => 100_000_002 }
>>>
>>
>>
>> I wonder (just thinking out loud here) if we could leverage a type spec
>> on the number to tell the formatter to leave the number as is?  I mean it
>> seems as if your issue is that it's treating what's essentially a long
>> string composed of only digits as a number rather than a string.
>>
>> I agree with Louis' point.  A formatter that allows for a lot of
>> customization rapidly loses the value of enforcing common conventions on
>> all code that's run through it.
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elixir-lang-core/d2eeb293-61b9-4139-84d7-49a7871522ef%40googlegroups.com
>> <https://groups.google.com/d/msgid/elixir-lang-core/d2eeb293-61b9-4139-84d7-49a7871522ef%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elixir-lang-core/siNPFCNkfrABhDqMwHw5_G5BxiyPsafcXpDqv0g457e7SF5TdpZr71PgeaezlV7T_OQNUYPDlC7Z8pa_kTbGLdwk9e_3L6hhJ-sBHv_CqVw%3D%40protonmail.com
>> <https://groups.google.com/d/msgid/elixir-lang-core/siNPFCNkfrABhDqMwHw5_G5BxiyPsafcXpDqv0g457e7SF5TdpZr71PgeaezlV7T_OQNUYPDlC7Z8pa_kTbGLdwk9e_3L6hhJ-sBHv_CqVw%3D%40protonmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/CA%2BbCVsvRe266R_yRvH_S5cDDetFm_%3DUEH4TKL%3D8Y%3DZiBjdBypg%40mail.gmail.com
> <https://groups.google.com/d/msgid/elixir-lang-core/CA%2BbCVsvRe266R_yRvH_S5cDDetFm_%3DUEH4TKL%3D8Y%3DZiBjdBypg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAJuWSyJEtyWq4hOq1c0giZ%3Dt3Tb85_eWwuVsFrsfS2uwM-t_6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to