All language subtitles for 173 Numeric Separators.en_US1

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Starting from year's 2021.

We can use a feature called "Numeric Separators"

to format numbers in a way

that is easier for us,

or for other developers to read and to understand.

Let's say that we wanted to represent

a really large number.

For example, the diameter of our solar system.

Let's say a diameter,

which is 287,460,000,000.

And just from looking at this number here,

it's really difficult to read and to understand it.

Does this mean like 28 billion or is it just 2 billion

or really what is this number?

It's really hard to read like this.

There is just too many zeros here.

Now to help with this,

when we write a number this large

under normal English language,

we usually use a thousand separator like the comma.

We would write this number like this.

And then it becomes really easy

to immediately see that this means 287,460,000,000.

And now, fortunately,

we can do the same thing in JavaScript as well,

using the new numeric separators.

Numeric separators are simply underscores

that we can place anywhere that we want in

or numbers,

and which will make it really easy to understand

and to parse numbers this large.

Using the underscore here as a thousand separator,

then makes it really easy to understand,

that this number here

means in fact, 287 billion.

Now let's just log it to the console

to see what JavaScript actually sees.

And so here we see that in fact,

the engine basically ignores these underscores.

So these numeric separators.

It simply sees the number itself.

And so what this means,

is that we can actually place the underscores,

the numeric separators, anywhere that we want.

Let's do another example.

Let's call this one price in cents,

and I'm gonna set it to 345_99.

Again, using the underscore here,

then makes it really obvious

that this is actually a price in cents.

Of course the number itself, does again,

not contain the underscore.

And our price is indeed 35,599 cents.

But by placing the underscore here,

it makes it really obvious,

that we have first this value here

and then this other value here in cents.

And in fact, it's so obvious that we could even get rid

of the cents part here in a variable name.

Basically we can use the underscore now

to give meanings to certain parts of our numbers.

Here we said, these are thousands,

and here we said that these are a cents.

Lets try another one.

Lets call this transfer fee.

And here again, we placed the underscore like this.

And so here immediately,

it looks like it is $15 for example and 0 cents.

But if we did the same thing like this,

so placing to underscore here,

then it suddenly looks like 1_500.

While in fact it is the exact same number.

Both of them are exactly 1,500.

But just the underscore alone,

gives them different meanings.

And so we can use that to our advantage,

whenever we write numbers in or JavaScript code.

Another variable here, called PI.

And this one is to show you some restrictions

as to where we can place the underscore.

PI is,

3.1415,

and we can only place underscores between numbers.

We could place it here,

and there would be no problem at all.

Lets just log it,

but actually to underscore

doesn't make a lot of sense here.

Lets remove it and let's say we wanted to place it here.

Here we get to an error,

because that is not allowed.

It's also not allowed to place here,

and also not at the beginning of a number or at the end.

All of these are illegal,

and like this it works,

but we can also not place two in a row.

The error message here is pretty explicit about that.

And now just one final detail that we need to be aware of

is that when we try to convert strings,

that contain underscores,

to a number that will not work as expected.

Lets try to use the number of function

that we learned before to convert a number.

Of course with this, it should work just fine,

We have 230,000 to the number or actually the string

and then here it converts to a number.

However, if we place an underscore here,

so if we want to have a numeric separator here,

that would not work.

Now it is not a number.

What that means,

is that you should really only use,

these numeric separators,

when you are writing down numbers like this.

Really in the code.

If you need to store a number in a string,

for example, in an API,

or if you get a number as a string from an API,

you should not use underscores in there,

because then JavaScript will not be able

to parse the number correctly out of that string.

It's not gonna work as expected

and you will get it's not a number,

that might then introduce bugs into your application.

And the same is true with the "parseInt" function.

Here we do not get not a number,

but we only get to 230.

Only the parts that is here in front of the underscore.

Everything else will then be ignored.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.