Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!