Need help with a math function [SOLVED]

Hi! I’m trying to have a command where users can put the command followed by three values and get a numerical response (this response being the highest possible number of full teams remaining in a BR) For example:

!fullteams T P S would calculate the ceiling of (P-T)/(S-1). Here’s what I have:

$(eval Math.ceil(($(2)-$(1))/($(3)-1)) “possible full teams remaining!”)

Right now it just prints exactly that out instead of calculating. What am I doing wrong?

Try this:

$(eval T=Math.ceil(($(2)-$(1))/($(3)-1));`${T} possible full teams remaining!`)

Let me know if this works as long as you enter real numbers it should.

1 Like

That did the trick! Thank you!!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.