Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
   <li>Baths and salt 2.00</li>
  <li>Baths2 and salt2 123.2424</li>
</body>
</html>
 
$("li").text(function (i,n){  var g=$(this).text().split(' ');debugger;
                            g[g.length-1]= parseFloat(g[g.length-1],10).toFixed(0); return g.join(' ');})
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers