There are way too many questions and answers about this basic functionality, I cannot see the wood for the trees.
In Java there is only one simple answer (jav
jav
Browser development progresses:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString
Number.toLocaleString(locale); // E.g. parseFloat("1234567.891").toLocaleString(window.document.documentElement.lang); "1,234,567.891"