Skip to content

Commit

Permalink
website: make locale-sensitive number formatting work in web browsers…
Browse files Browse the repository at this point in the history
… without requestIdleCallback
  • Loading branch information
rsms committed Nov 20, 2023
1 parent 346a08d commit 8cadd9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,7 @@ <h4 id="{{c.id}}"><a href="#{{c.id}}">{{c.q}}</a></h4>
observer.observe($('h1'))

// low priority stuff that doesn't need to happen immediately
requestIdleCallback(() => {
;(typeof requestIdleCallback == "undefined" ? f => f() : requestIdleCallback)(() => {
// convert .num/num numbers to local format, e.g. "1,234.56" vs "1.234,56"
let nfmt = new Intl.NumberFormat() // test with .NumberFormat('de-DE')
if (nfmt.format(1234.89) != "1,234.89") { // written as "1,234.89" in source
Expand Down

0 comments on commit 8cadd9a

Please sign in to comment.