Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  
</head>
<body>
  <table>
  <tr>
    <td class="ndLabel" style="position: relative; width: 470px; top:-4px" id="avPurchase03">Average, &euro;:</td>
    <td colspan="2">
      <input id="lpcfIn02Id" class="ndInbox" type="text" value="" />
    </td>
  </tr>
  <tr>
    <td class="ndLabel" style="position: relative; width: 470px; top:-4px" id="avNumber03">Budget, &euro;:</td>
    <td colspan="2">
      <input id="lpcfIn03Id" class="ndInbox" type="text" value="" />
    </td>
  </tr>
</table>
  <script>
    $(function(){
        $('.ndInbox').blur(function(){
            // Get your formatted number
            var formatted = Number($(this).val().replace(/\s/g,'')).toFixed(2);
            // Split off any decimal value (there should be one)
            var sections = formatted.split('.');
            // Replace every third digit with a space
            sections[0] = sections[0].replace(/\B(?=(\d{3})+\b)/g, " ");
            // Output the updated and rejoined sections
            $(this).val(sections.join('.'));
        });
    });
    
   
  </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
rionmonsterpro
0viewers