site/components/comma.js
2022-12-17 20:51:20 -05:00

3 lines
115 B
JavaScript

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