Better punctuation

This commit is contained in:
K-Sato 2019-06-24 14:56:52 +09:00 committed by GitHub
parent 816bc5e8a6
commit a4a1d66fa1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@ Imagine we need to write 1 billion. The obvious way is:
let billion = 1000000000;
```
But in real life we usually avoid writing a long string of zeroes as it's easy to mistype. Also, we are lazy. We will usually write something like `"1bn"` for a billion or `"7.3bn"` for 7 billion 300 million. The same is true for most large numbers.
But in real life, we usually avoid writing a long string of zeroes as it's easy to mistype. Also, we are lazy. We will usually write something like `"1bn"` for a billion or `"7.3bn"` for 7 billion 300 million. The same is true for most large numbers.
In JavaScript, we shorten a number by appending the letter `"e"` to the number and specifying the zeroes count: