Missing space on statistic component

Hi guys, when using the statistic component in a currency format the end result is being displayed like this:

However according to ISO 80000‑1 there should be a space between the number and the currency symbol. Could this be fixed?

1 Like

Hello @Rupur ,

To ensure compliance with ISO 80000-1, you can format the Statistic component in Retool to include a space between the number and the currency symbol. Use the following JavaScript in the value field:

const amount = 1234.56;
`${amount.toLocaleString('en-US', { minimumFractionDigits: 2 })} $`
3 Likes

Thank you for the great answer @WidleStudioLLP!!!

Just to add on, entering that above code snippet into the value input field for the Statistic component did throw an error as the component expects a number, but the JS interpolation from the code snippet results in a string.

What I found that does work is putting the above code snippet into a JS Query block, and then using the query.data source for the Statistic component will work as intended!