Comma seprated number (india and us currency)

PHOTO EMBED

Fri Sep 08 2023 16:59:55 GMT+0000 (Coordinated Universal Time)

Saved by @pradhyumnsoni #react.js #javascript #ubuntu #apache #linux #var/www/htm

// for india currency ruppes
  commaSeparatedNumber: (number) => {
    return (
      number
        ?.toString()
        ?.replaceAll(",", "")
        // ?.replace(/(\.\d{2})\d*/, "$1,")
        ?.replace(/(\d)(?=(\d\d)+\d$)/g, "$1,")
    );
  },

// for us currency ruppes 
  commaSeparatedNumber: (number) => {
    return (
      number
        ?.toString()
        ?.replaceAll(",", "")
        // ?.replace(/(\.\d{2})\d*/, "$1,")
           ?.replace(/(\d)(?=(\d{3})+\b)/g, "$1,")

    );
content_copyCOPY

India first life future wealth calculator 8/9/23

https://stackoverflow.com/questions/16037165/displaying-a-number-in-indian-format-using-javascript