#Math

6 messages · Page 1 of 1 (latest)

loud flicker
#

how to round this up

    const price = options.getInteger('price')
    const total = price/0.70

how can I round this up? Its outputing 142.85714285714286

mild spireBOT
#
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
frozen zinc
#

Or you can do Math.floor to round down

young pumice
#

ceil() is to always round up

#

and there's parseInt to just cut off the decimals (which in effect is just floor)