Need help with a math function [SOLVED]

Asked Oct 16, 2020·2 replies·Last activity 5 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

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?
Thanks!

2 replies

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.