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

146
Views
Simple calculation produces decimal number

I don't understand why 500 * (1 - 80/100) results in 99.99999999999997 instead of 100. Where does that come from?

const storage = {
  rawDataVolumeAtGoLive: 500,
  compressionRate: 80,
}

function getCompressedVolumeAtGoLive(storage) {
  if (storage.rawDataVolumeAtGoLive && storage.compressionRate !== null) {
    console.log('storage.rawDataVolumeAtGoLive', storage.rawDataVolumeAtGoLive);
    console.log('storage.compressionRate', storage.compressionRate);
    return storage.rawDataVolumeAtGoLive * (1 - storage.compressionRate / 100);
  }
  return 0;
}

console.log(getCompressedVolumeAtGoLive(storage));

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!