Convert value from a component select options em number

1

I have a select component and would like to convert the value to the Number format because when I save it I need a value 2 and not "2"

The ideal would be to convert all tag <option>

          <div class="form-group col-md-3">
              <label class="lb">Tipo docto liquidação:</label> 
              <select ng-model="notaLiquidacao.idTipoDoctoLiquidacao"  class="form-control" >
                <option  value=2>Nota Fiscal de Produtor</option> 
                <option  value=3>Nota Fiscal</option>
                <option  value=4>Contranota de Venda</option>
                <option  value=6>DANFE</option>                   
              </select>

            </div>
    
asked by anonymous 28.02.2018 / 20:10

1 answer

1

Use parseInt()

<script>
  var meuNumber =  parseInt($(".form-control").val());
</script>
    
28.02.2018 / 20:20