Skip to content

Add numeric separators#1236

Open
vieira wants to merge 5 commits intopangloss:masterfrom
vieira:numeric-separator
Open

Add numeric separators#1236
vieira wants to merge 5 commits intopangloss:masterfrom
vieira:numeric-separator

Conversation

@vieira
Copy link
Contributor

@vieira vieira commented May 20, 2021

Add syntax highlighting to numbers and floats with numeric separator as defined in tc39/proposal-numeric-separator.

let fee = 123_00;       // $123 (12300 cents, apparently)
let fee = 12_300;       // $12,300 (woah, that fee!)
let amount = 12345_00;  // 12,345 (1234500 cents, apparently)
let amount = 123_4500;  // 123.45 (4-fixed financial)
let amount = 1_234_500; // 1,234,500

let millionth  = 0.000_001 // 1 millionth

let nibbles = 0b1010_0001_1000_0101;

let message = 0xA0_B0_C0;

vieira and others added 5 commits May 20, 2021 02:26
Add syntax highlighting to numbers and floats with numeric separator as defined in tc39/proposal-numeric-separator.
Numeric separators are also allowed in the exponent as per the spec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant