site/components/comma.js
2023-03-07 10:14:59 -05:00

5 lines
139 B
JavaScript

export default function Comma({ children }) {
return children
? children.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')
: ''
}