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

199
Views
JSLint Character Unexpected '.'

Atoms's JSLint report is complaining about an unexpected dot of the .toFixed function:

subTotal = (Math.round(subTotal * 100) / 100).toFixed(2);

at line 113, character 50 Unexpected '.'

The code works fine,

Question: Is this a fault with JSLint or have I coded something wrong?

Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

jslint doesn't like the dot "." after a naked, parenthesized expression. adding a Number in front of ( should fix the warning. the other common-case is adding a String in front of (.

subTotal = Number(Math.round(subTotal * 100) / 100).toFixed(2);
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!