Gist e75fdfd9429caf37873275cd41779b88
This example demonstrates a custom formatting function that inserts non-breaking spaces as thousands separators, a convention common in Finnish numeric formatting. The function, `spaceSeparateNumber`, iteratively processes the input number using a regular expression to identify digit groups, replacing them with a space between the leading digits and the trailing three-digit group. It relies on JavaScript’s string replacement and number-to-string conversion, without any external libraries. The visualization likely applies this formatting to numeric labels in a chart, ensuring readable, localized display of large values. The code focuses solely on text transformation, not on rendering or data binding, making it a standalone utility for formatting axis ticks or tooltip values.