JSFiddle - React, Tailwind, and code Playground

by Nick Craver

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">

JavaScript

var str = "15,678";
alert(parseInt(str.replace(/,/g,''), 10));
//or
alert(parseFloat(str.replace(/,/g,'')));