DEV Community

Cover image for Numeric Separators
Shubham Battoo
Shubham Battoo

Posted on • Originally published at shubhambattoo.in

11 3

Numeric Separators

Reading large numbers is difficult most of the time, using the latest proposal for Numeric Separators is going to make this job easy.

For example, say you have the following number:

let budget = 1000000000;
Enter fullscreen mode Exit fullscreen mode

It's hard for the human eye to detect what is the actual order in here.

But, by using the Numerical Separators, it can be rewritten in the following way:

let budget = 1_000_000_000;
Enter fullscreen mode Exit fullscreen mode

We can easily tell by separating them with underscores that this is a billion.

Support

There is fairly good support for this feature in the latest browsers:

Found it very neat. Let me know how you guys feel about this?

Further Learning

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (2)

Collapse
 
transiient profile image
Transient

I didn't even know I needed this. Makes things so much easier to read. Excellent!

Collapse
 
shubhambattoo profile image
Shubham Battoo

True, it really helps with readability.

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more