Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

193
Vistas
How to convert a single quoted number or integer like '265' to actual integer like 265 using parseInt?

I am giving code like this

But getting the output as Nan

var totalTicketOpenCountFromWidget = sunriseReportObj.getIncidentDsrTotalTicketOpenCount(sunriseReportTestData.totalOpenTicketsWidgetName);
console.log("totalTicketOpenCountFromWidget :", totalTicketOpenCountFromWidget);
var totalTicketOpenCountFromWidgetIntVal = parseInt(totalTicketOpenCountFromWidget);
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you have the way to ensure totalTicketOpenCountFromWidget would be a number you can do:

totalTicketOpenCountFromWidgetIntVal = parseInt(totalTicketOpenCountFromWidget);

or

totalTicketOpenCountFromWidgetIntVal = parseInt(totalTicketOpenCountFromWidget, 10);

the 10 aims to decimal.

Read more here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt

or the easier way:

totalTicketOpenCountFromWidgetIntVal = +totalTicketOpenCountFromWidget;

Also, you can wrap your conversion in a try ... catch block to handle the response if totalTicketOpenCountFromWidget is not a number. Read more here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda