Skip to content

Commit

Permalink
add fixROE to lib
Browse files Browse the repository at this point in the history
  • Loading branch information
KetyaNop committed Nov 20, 2017
1 parent 51e11a6 commit fc65794
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/fixROE.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function fixRoundOffError(toFix){
toFix = Math.round((toFix * 100))/100;
toFix = toFix.toString();
if (toFix[toFix.indexOf(".")+2] == undefined && toFix[toFix.indexOf(".")] != undefined){
toFix = toFix.concat("0");
}
return parseFloat(toFix);
}

module.exports = {
fixROE: fixRoundOffError
}

0 comments on commit fc65794

Please sign in to comment.