i was hoping someone could tell me how to make a command where nighbot will do multiplication
for exapmle , when one types; !maths 20 1080 . it replies" 54 is the average of a division by 20"
its simple math but i dont want there to be a sign like (*) to be there
highly appreciated
Math division in nighbot
7 replies
Ok I’m going with the example you gave at the beginning divider first dividee second it rounds to nearest two decimals if any.
$(eval N=decodeURIComponent(`$(querystring)`).split(` `);isNaN(parseInt(N[0]))?N1=1:N1=parseInt(N[0]);isNaN(parseInt(N[1]))?N2=1:N2=parseInt(N[1]); Math.round(((N2/N1)+Number.EPSILON)*100)/100)
Btw any non number inputs will become 1 !maths 20 returns 0.05
Didn't find your answer? The community is on Discord.
Ask on Discord