-
Notifications
You must be signed in to change notification settings - Fork 12
New Features about Number.prototype.toLocaleString() for IE11 in win7 and 8, a lot of related new definitions (Final PR)
#67
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
09624fc
da3052a
53b9f10
f02c9b5
7d8bf9a
ae4d17c
6ec6164
15dee6c
2b3c3f2
ea77719
864b4ac
2af0b6a
6c55dfa
c867f98
0eb05e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -775,6 +775,157 @@ | |||||||||||||||||||
| } | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| LOCALE_NUMERALS_IE11_WIN7: | ||||||||||||||||||||
| function () | ||||||||||||||||||||
| { | ||||||||||||||||||||
| registerNumberToLocaleStringAdapter | ||||||||||||||||||||
| ( | ||||||||||||||||||||
| this, | ||||||||||||||||||||
| function (locale) | ||||||||||||||||||||
| { | ||||||||||||||||||||
| switch (locale) | ||||||||||||||||||||
| { | ||||||||||||||||||||
| case 'lv': | ||||||||||||||||||||
| switch (+this) // In Internet Explorer 9, +this is different from this. | ||||||||||||||||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Internet Explorer 9 is no longer supported, so it's fine to use just
Suggested change
Same for the other occurrences in this file. |
||||||||||||||||||||
| { | ||||||||||||||||||||
| case Infinity: | ||||||||||||||||||||
| return 'bezgalība'; | ||||||||||||||||||||
| case -Infinity: | ||||||||||||||||||||
| return '-bezgalība'; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case 'ru': | ||||||||||||||||||||
| switch (+this) // In Internet Explorer 9, +this is different from this. | ||||||||||||||||||||
| { | ||||||||||||||||||||
| case Infinity: | ||||||||||||||||||||
| return 'бесконечность'; | ||||||||||||||||||||
| case -Infinity: | ||||||||||||||||||||
| return '-бесконечность'; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| LOCALE_NUMERALS_IE11_WIN7_8: | ||||||||||||||||||||
| function () | ||||||||||||||||||||
| { | ||||||||||||||||||||
| registerNumberToLocaleStringAdapter | ||||||||||||||||||||
| ( | ||||||||||||||||||||
| this, | ||||||||||||||||||||
| function (locale) | ||||||||||||||||||||
| { | ||||||||||||||||||||
| var returnValue; | ||||||||||||||||||||
| var number; | ||||||||||||||||||||
| number = Number(this); | ||||||||||||||||||||
| switch (locale) | ||||||||||||||||||||
| { | ||||||||||||||||||||
| case 'ar': | ||||||||||||||||||||
| if (isNaN(number)) | ||||||||||||||||||||
| returnValue = 'ليس\xa0برقم'; | ||||||||||||||||||||
| else if (+this === Infinity) | ||||||||||||||||||||
| returnValue = '+لا\xa0نهاية'; | ||||||||||||||||||||
| else if (+this === -Infinity) | ||||||||||||||||||||
| returnValue = '-لا\xa0نهاية'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case 'cs': | ||||||||||||||||||||
| if (isNaN(number)) | ||||||||||||||||||||
| returnValue = 'Není\xa0číslo'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case 'el': | ||||||||||||||||||||
| if (isNaN(number)) | ||||||||||||||||||||
| returnValue = 'μη\xa0αριθμός'; | ||||||||||||||||||||
| else if (+this === Infinity) | ||||||||||||||||||||
| returnValue = 'Άπειρο'; | ||||||||||||||||||||
| else if (+this === -Infinity) | ||||||||||||||||||||
| returnValue = '-Άπειρο'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case 'he': | ||||||||||||||||||||
| if (isNaN(number)) | ||||||||||||||||||||
| returnValue = 'לא\xa0מספר'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case 'ja': | ||||||||||||||||||||
| if (isNaN(number)) | ||||||||||||||||||||
| returnValue = 'NaN\xa0(非数値)'; | ||||||||||||||||||||
| else if (+this === Infinity) | ||||||||||||||||||||
| returnValue = '+∞'; | ||||||||||||||||||||
| else if (+this === -Infinity) | ||||||||||||||||||||
| returnValue = '-∞'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case 'lt': | ||||||||||||||||||||
| switch (+this) // In Internet Explorer 9, +this is different from this. | ||||||||||||||||||||
| { | ||||||||||||||||||||
| case Infinity: | ||||||||||||||||||||
| returnValue = 'begalybė'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case -Infinity: | ||||||||||||||||||||
| returnValue = '-begalybė'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case 'pl': | ||||||||||||||||||||
| switch (+this) // In Internet Explorer 9, +this is different from this. | ||||||||||||||||||||
| { | ||||||||||||||||||||
| case Infinity: | ||||||||||||||||||||
| returnValue = '+nieskończoność'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case -Infinity: | ||||||||||||||||||||
| returnValue = '-nieskończoność'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case 'zh': | ||||||||||||||||||||
| switch (+this) // In Internet Explorer 9, +this is different from this. | ||||||||||||||||||||
| { | ||||||||||||||||||||
| case Infinity: | ||||||||||||||||||||
| returnValue = '正无穷大'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case -Infinity: | ||||||||||||||||||||
| returnValue = '负无穷大'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| case 'zh-cn': | ||||||||||||||||||||
| if (isNaN(number)) | ||||||||||||||||||||
| returnValue = '非数字'; | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| return returnValue; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| LOCALE_NUMERALS_IE11_WIN8: | ||||||||||||||||||||
| function () | ||||||||||||||||||||
| { | ||||||||||||||||||||
| registerNumberToLocaleStringAdapter | ||||||||||||||||||||
| ( | ||||||||||||||||||||
| this, | ||||||||||||||||||||
| function (locale) | ||||||||||||||||||||
| { | ||||||||||||||||||||
| switch (locale) | ||||||||||||||||||||
| { | ||||||||||||||||||||
| case 'lv': | ||||||||||||||||||||
| switch (+this) // In Internet Explorer 9, +this is different from this. | ||||||||||||||||||||
| { | ||||||||||||||||||||
| case Infinity: | ||||||||||||||||||||
| return '∞'; | ||||||||||||||||||||
| case -Infinity: | ||||||||||||||||||||
| return '-∞'; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| break; | ||||||||||||||||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above, this isn't needed
Suggested change
|
||||||||||||||||||||
| case 'ru': | ||||||||||||||||||||
| switch (+this) // In Internet Explorer 9, +this is different from this. | ||||||||||||||||||||
| { | ||||||||||||||||||||
| case Infinity: | ||||||||||||||||||||
| return '∞'; | ||||||||||||||||||||
| case -Infinity: | ||||||||||||||||||||
| return '-∞'; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| break; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| NAME: | ||||||||||||||||||||
| function () | ||||||||||||||||||||
| { | ||||||||||||||||||||
|
|
||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Latvian is not used in definitions with this feature, it's fine to leave it out. We could mention only Russian.
Another thing I noticed is that this feature is supported in all modern browsers, so the name and the description don't seem to fit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just repurposed that into
RUSSIAN_INFINITYfor modern browsers usage.