How to add 3 digit comma separator

Hi @Shinsuke_Kubo, the ability to separate the numbers with commas is not built in, but using a little custom script put into the head of the site and a little custom code in an embed widget should do the trick.

Paste this in Site Settings > Header Code:

<script>
function numberWithCommas(x) {
    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
</script>

Call the function above, using an Embed Code component, placed on the page you want the value to be shown. I would use some custom code similar to:

Here is a working example where I am displaying a number field in a dynamic list:
http://cms-number-separator.webflow.io

The commas will only appear on the published site.

4 Likes