Support underscores in numbers

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Support underscores in numbers

Alexander Craggs
Large number are hard to read in JavaScript, is 2384923842 over a billion?  Or just several hundred million.  One solution to this some languages have used is to allow underscores within numbers. You can immediately recognise 2_384_923_842 is a number in the billions, rather than millions.

It would be nice to have such delimiters in large numbers in JavaScript as well, and I don't think it would be breaking.

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Support underscores in numbers

kdex
See [1].

[1] https://github.com/tc39/proposal-numeric-separator

On Wednesday, July 26, 2017 10:47:27 PM CEST Alexander Craggs wrote:
> Large number are hard to read in JavaScript, is 2384923842 over a billion?
>  Or just several hundred million.  One solution to this some languages have
> used is to allow underscores within numbers. You can immediately recognise
> 2_384_923_842 is a number in the billions, rather than millions.
>
> It would be nice to have such delimiters in large numbers in JavaScript as
> well, and I don't think it would be breaking.
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Support underscores in numbers

Logan Smyth
In reply to this post by Alexander Craggs
There is currently an active proposal for this: https://github.com/tc39/proposal-numeric-separator

On Wed, Jul 26, 2017 at 1:47 PM, Alexander Craggs <[hidden email]> wrote:
Large number are hard to read in JavaScript, is 2384923842 over a billion?  Or just several hundred million.  One solution to this some languages have used is to allow underscores within numbers. You can immediately recognise 2_384_923_842 is a number in the billions, rather than millions.

It would be nice to have such delimiters in large numbers in JavaScript as well, and I don't think it would be breaking.

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss



_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Support underscores in numbers

Alexander Craggs
Oops, I'm an idiot and didn't see this.

On 26/07/2017 21:49:11, Logan Smyth <[hidden email]> wrote:

There is currently an active proposal for this: https://github.com/tc39/proposal-numeric-separator

On Wed, Jul 26, 2017 at 1:47 PM, Alexander Craggs <[hidden email]> wrote:
Large number are hard to read in JavaScript, is 2384923842 over a billion?  Or just several hundred million.  One solution to this some languages have used is to allow underscores within numbers. You can immediately recognise 2_384_923_842 is a number in the billions, rather than millions.

It would be nice to have such delimiters in large numbers in JavaScript as well, and I don't think it would be breaking.

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss



_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Support underscores in numbers

T.J. Crowder-2
On Wed, Jul 26, 2017 at 9:50 PM, Alexander Craggs <[hidden email]> wrote:
> Oops, I'm an idiot and didn't see this.

:-) Just FWIW for future (and lurkers), proposals are listed in the [proposals repo](https://github.com/tc39/proposals) (that links to active; also check "inactive" and "finished" which it links to). Also worth searching the [mailing list archive](https://mail.mozilla.org/pipermail/es-discuss/) and/or [esdiscuss.org](https://esdiscuss.org/1) (which provides a different -- and searchable -- view of the list).

-- T.J. Crowder

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss