Sort decimal numbers with Intl.Collator, and the enable option numericincorrectly compares decimals.
Intl.Collator
numeric
In some browsers comparing β0.005β and β0.05β, β0β is returned, since the numbers are the same.
Results in different browsers:
// Returns 0 console.log(new Intl.Collator(undefined, { numeric: true}).compare(0.000005, 0.05))
Anyone who can tell me what's wrong?
Report a bug in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1312388
Firefox, , Unicode Number, . , , , U + 002E FULL STOP Number ( ).
, - "0,05" "0,000005" - :
["0", ".", "05"] ["0", ".", "000005"]
, ,
[0, ".", 5] [0, ".", 5]
, compare 0 . Firefox Chrome , IE Edge .
compare
Source: https://habr.com/ru/post/1658083/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1658078/docker-container-for-windows-desktop-app&usg=ALkJrhh7jLMwJDAkZnnYclsGncNF-yOeygAngular2 DI: How to introduce dependency in @NgModule? - dependency-injectionIs it good practice to have an additional docker container for build tasks? - dockerHow to get data values ββin bootstrap module using jQuery or javascript when clicking a button inside a modal? - javascriptGoogle Foobar power_hungry - javaUsing declaration in template of derived class not recognized by g ++ - c ++Combination of FPgrowth calculations in pyspark vs scala - scalaCopy S3 Bucket, including versions - copyHow can I deploy a Grails 3 application on Tomcat 7? - springWhy spring-boot does not connect to the local mysql server? - javaAll Articles