I have variables that contain amounts and would like to remove the (US) thousand separators but also have to cover the scenario that there may be non-US formatted amounts wh
if (string.match(/\.\d{2}$/) { string = string.replace(',', ''); }
or
string.replace(/,(?=.*\.\d+)/g, '');