Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/05/2019, 00:51
Avatar de enlinea777
enlinea777
 
Fecha de Ingreso: mayo-2008
Ubicación: frente al pc
Mensajes: 1.830
Antigüedad: 16 años
Puntos: 127
Respuesta: Redondeo en input

asi: Math.round(el_valor);

Código Javascript:
Ver original
  1. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  2.     <script type="text/javascript">
  3.         $('.solonumeros').on('input', function () {
  4.         this.value = Math.round(this.value.replace(/[^,.0-9]/g, ''));
  5.    
  6. });
  7.     </script>

referencia:https://www.w3schools.com/jsref/jsref_round.asp