Thousand separator in numeric type literals
bijumaillist at gmail.com
Mon Apr 30 00:14:46 PDT 2012
One of the issue in most programming languages is, they dont have a
mechanism to insert Thousand separators in numeric literals.
Recently, at work I have fixed a production bug by adding extra "0" in
a numeric literal in a JS code on a page.
Since long I wish there are is a mechanism to represent Thousand
separator in Java Script numeric literals, to make code more readable.
I see the use of underscore to do this in Ruby
By adding a Thousand separator in the code will reduce a great number
of such errors.
123_456 # Fixnum (underscore ignored)
123_456_789_123_345_789 # Bignum
-0b101_010 # Binary (negated)
More information about the es-discuss