rewrite percantage calculator with node.js