To format the number with commas for thousands, you can use the toLocaleString()
method without adding decimals. Here's the updated JSX:
{totalRecords.toLocaleString()} properties for sale
This will display numbers like 1,585
instead of 1585
, and 23,455
instead of 23455
.