Calculate value based on percentage
by jonjieviduya
JavaScript
function getValuationValue(number, percentage) {
var percent = (percentage / 100) * number.toString().replace(',', '')
return Math.round((percent + Number.EPSILON) * 100) / 100
}
console.log(getValuationValue(9033.20, 2))
console.log(getValuationValue(1644.25, 2))
console.log(getValuationValue(1.255, 2))