Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
  <meta charset="utf-8">
  <title>Example</title>
</head>
<body>
  <div><input type="text" value="123.45678"></div>
  <div><input type="text" value="17.875"></div>
  <div><input type="text" value="514.972"></div>
  <div id="counter"></div>
<script>
  (function() {
    "use strict";
    
    var counter = 4;
    
    countdown();
    
    function countdown() {
      --counter;
      $("#counter").text(counter);
      if (counter === 0) {
        roundTextBoxes();
      } else {
        setTimeout(countdown, 500);
      }
    }
    
    function roundTextBoxes() {
      $("input[type=text]").val(function() {
        return (+this.value).toFixed(2);
      });
    }
  })();
</script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
tjcrowderpro
0viewers