When digging into Decimal and Thousands Separators, I learnt about a different technique to implement spaced digit grouping.
Wikipedia uses HTML and CSS to display the spaces in big numbers. The benefit is that users can read big numbers with thousands separators, but they can also copy the actual number without whitespace characters inserted in the data as delimiters.
<!-- This bananas HTML will display: 123 456 789 --> <span> 123 <span style="margin-left:.25em;">456</span> <span style="margin-left:.25em;">789</span> </span>
Data versus mask
Digit group separators can occur either as part of the data or as a mask through which the data is displayed. This is an example of the separation of presentation and content, making it possible to display numbers with spaced digit grouping in a way that does not insert any whitespace characters into the string of digits in the content.
Wikipedia: Manual of Style
Note that use of any space character as a separator in numbers, including non-breaking space, is problematic for screen readers. Screen readers read out each group of digits as separate numbers (e.g. 30 000 is read as “thirty zero zero zero”.)
I had never thought about how AT or specifically screen readers handle large numbers. Now that I am, I can’t seem to find many resources explaining which considerations to make. I’m guessing it really depends on the context. In some cases, it’s probably okay if a large sum is read out in groups. But for other use cases, it must be super weird and unhelpful.
Phone number and ARIA
One helpful article I found, is Accessibility and phone number formatting by Joni Halabi.
A US phone number is normally written as “(703) 555-1212”. A screen reader will read this number as “seven hundred three (pause) five hundred fifty-five minus one thousand two hundred twelve.” The digits are read as large numbers. The reader treats the exchange and number as a math equation.