I’m trying to calculate mosaic fees of mosaic transfer in javascript. I was following https://nemproject.github.io/#transaction-fees And this is what I came up with:
function calculateFee(message, mosaicQuantity){
let initialSupply = 100000000 // initial amount of mosaic, hundred millions(testing mosaic)
let mosaicDivisibility = 6 // (for testig mosaic)
let totalQuantity = initialSupply * Math.pow(10,mosaicDivisibility);
let messageFee = ((message.length / 32 + 1) * 0.05)// message fee
let adjustment = Math.floor(0.8 * Math.log(9000000000000000 / totalQuantity))
let xemfee= Math.min(25,mosaicQuantity*900000/initialSupply)
....
return messageFee + xemFee
}
How is xemFee calculated, there is no explanation for that only final calculation. 149,999 = 14XEM