Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function() {
  2.             $("#smstext").on('keyup paste', function(){
  3.  
  4.             var Characters = $("#smstext").val().replace(/(<([^>]+)>)/ig,"").length; // '$' is missing from the selector
  5.  
  6.             $("#counter").text(Characters);
  7.             var sms = (Characters/70*1).toFixed(0.99);
  8.             $("#smscount").text(sms);
  9.             $("#itog").text(sms*1.74 + 'руб.');
  10.  
  11.  
  12.         });
  13.  
  14.         function toFixed( num, precision ) {
  15.             return (+(Math.round(+(num + 'e' + precision)) + 'e' + -precision)).toFixed(precision);
  16.         }
  17.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement