You are viewing a single comment's thread from:RE: Calculating a user's Steemit reputation score in JavaScript [bonus content: an Angular Pipe that does it for you]View the full contextView the direct parentmkt (66)in #steemdev • 8 years ago hmmm... it should be conditional then. return precision ? reputation.toFixed(precision) : Math.floor(reputation);
Yeah, or something like this:
function toPrecision(value, precision) { const multiplier = Math.pow(10, precision); return Math.floor(value * multiplier) / multiplier; }