i'm using ejs in the browser,
so I was trying to use regex to add a thousand separator, it works fine in vanilla js but it doesn't seem to work in ejs.
<%= product.price.toString().replace(/\B(?=(\d{3})+(?!\d))/,","); %>
i'm using ejs in the browser,
so I was trying to use regex to add a thousand separator, it works fine in vanilla js but it doesn't seem to work in ejs.
<%= product.price.toString().replace(/\B(?=(\d{3})+(?!\d))/,","); %>