JavaScript numeric separators are cross-browser supported (#blogPost)

Suppose you’re dealing with big numbers in JavaScript, you might know that they’re becoming harder to read with every digit. Look at 123456789 – how many millions is that? I don’t know! 🤷‍♂️
To solve this readability issue JavaScrip…


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis

Suppose you're dealing with big numbers in JavaScript, you might know that they're becoming harder to read with every digit. Look at 123456789 – how many millions is that? I don't know! 🤷‍♂️

To solve this readability issue JavaScript implements numeric separators.

// Make large numbers more readable with numeric separators

console.log(1_234_456_789.01);
// 1234456789.01

I was aware that the language addition is around the corner, but surprisingly, I just realized, they're cross-browser-supported these days! 🎉

MDN Compat Data (source)
Browser support info for Numeric separators (1_000_000_000_000)
chrome chrome_android edge firefox firefox_android safari safari_ios samsunginternet_android webview_android
75 75 79 70 79 13 13 11.0 75


Reply to Stefan


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis


Print Share Comment Cite Upload Translate Updates
APA

Stefan Judis | Sciencx (2022-01-14T23:00:00+00:00) JavaScript numeric separators are cross-browser supported (#blogPost). Retrieved from https://www.scien.cx/2022/01/14/javascript-numeric-separators-are-cross-browser-supported-blogpost/

MLA
" » JavaScript numeric separators are cross-browser supported (#blogPost)." Stefan Judis | Sciencx - Friday January 14, 2022, https://www.scien.cx/2022/01/14/javascript-numeric-separators-are-cross-browser-supported-blogpost/
HARVARD
Stefan Judis | Sciencx Friday January 14, 2022 » JavaScript numeric separators are cross-browser supported (#blogPost)., viewed ,<https://www.scien.cx/2022/01/14/javascript-numeric-separators-are-cross-browser-supported-blogpost/>
VANCOUVER
Stefan Judis | Sciencx - » JavaScript numeric separators are cross-browser supported (#blogPost). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/14/javascript-numeric-separators-are-cross-browser-supported-blogpost/
CHICAGO
" » JavaScript numeric separators are cross-browser supported (#blogPost)." Stefan Judis | Sciencx - Accessed . https://www.scien.cx/2022/01/14/javascript-numeric-separators-are-cross-browser-supported-blogpost/
IEEE
" » JavaScript numeric separators are cross-browser supported (#blogPost)." Stefan Judis | Sciencx [Online]. Available: https://www.scien.cx/2022/01/14/javascript-numeric-separators-are-cross-browser-supported-blogpost/. [Accessed: ]
rf:citation
» JavaScript numeric separators are cross-browser supported (#blogPost) | Stefan Judis | Sciencx | https://www.scien.cx/2022/01/14/javascript-numeric-separators-are-cross-browser-supported-blogpost/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.