DEV Community

Discussion on: How important are math skills for software development?

Collapse
 
iamandrewluca profile image
Andrei Luca

I mean, you have to know minimal math

const exactPercent = totals[index] / totals[0] * 100
const percent = isNaN(exactPercent) ? 0 : exactPercent - Math.floor(exactPercent) === 0
  ? exactPercent
  : exactPercent.toFixed(1)