how to use regex in ejs (browser build)?

Viewed 81

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))/,","); %>
0 Answers
Related