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

125
Views
Number is concatenated instead of adding it mathematically java script
let lst_val ;
let off_set = 0;
function genTicks(value, index, ticks)
{
   if (index == 0)
   {
      lst_val = ticks[0].value;
      off_set = (ticks[ticks.length - 1].value - ticks[0].value) / ticks.length;
      let gh = new Date(ticks[0].value);
      return gh.getDate() + " " + gh.getHours()+ ":" + gh.getMinutes()+ ":" + gh.getSeconds();
   }
   lst_val = lst_val + off_set;
   let gh = new Date((lst_val + (off_set*index)));
   console.log("tt: ",lst_val);
   return gh.getDate() + " " +gh.getHours()+ ":" + gh.getMinutes()+ ":" + gh.getSeconds();
}

output looks like thi

tt:  Sat Jan 01 2022 00:00:00 GMT+0500 (Pakistan Standard Time)9967333.3333333349967333.3333333349967333.3333333349967333.3333333349967333.3333333349967333.3333333349967333.3333333349967333.333333334

I am trying to add two numbers. but is treating them as a number. Any fix for this.

Thanks in Advance.

about 4 years ago · Juan Pablo Isaza
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!