Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add numeric separators #1236

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

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