Help for this page

Select Code to Download


  1. or download this
    s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g;
    
  2. or download this
    s/(
       ^[-+]?            # beginning of number.
    ...
       \G\d{3}           # after the last group, get three digits
       (?=\d)            # but they have to have more digits after them.
    )/$1,/xg;