// src/helpers/ad.js
export function formatNumber(x) {
  return x?.toString().replace(/B(?=(d{3})+(?!d))/g, ",");
}

// AdCard.js
import { formatNumber } from "../../helpers/ad";

// AdView.js
import { formatNumber } from "../../helpers/ad";

// under AdFeatures
<h3 className="mt-5 h2">${formatNumber(ad?.price)}</h3>

Use day.js for date formatting

npm i dayjs
// AdView.js
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";

dayjs.extend(relativeTime);

// under price
<p className="d-flex justify-content-between mt-4">
  <span>Added {dayjs(ad?.createdAt).fromNow()}</span>{" "}
  <span>{ad?.views} Views</span>
</p>