formatNumber()
ignores current language convention while formatting numbers
#2951
Milestone
formatNumber()
ignores current language convention while formatting numbers
#2951
Polish language uses space as thousands separator, so
100000
should be formatted as100 000
. But it looks likeformatNumber()
has really simple implementation with hardcoded comma as separator:https://github.com/flarum/core/blob/d4e3254395fa03a0653218a543e23ad9de76ae77/js/src/common/utils/formatNumber.ts#L9-L11
It may be a good idea to switch to something like
Intl.NumberFormat
ortoLocaleString()
instead - bothnew Intl.NumberFormat('pl').format(number)
andnumber.toLocaleString('pl')
returns correct format.The text was updated successfully, but these errors were encountered: