Add math.sqrt in a calc command

9 Replies
d.js toolkit
d.js toolkitā€¢10mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - 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! - āœ… Marked as resolved by staff
./u.7-z
./u.7-zOPā€¢10mo ago
./u.7-z
./u.7-zOPā€¢10mo ago
help me pls
const PI = Math.PI;
const ann = Math.floor(Math.random() * 100) + 1;
const x = '50'
const sqr = Math.sqrt


// Remplacement des occurrences de 'pi' ou 'Ļ€' par la valeur de PI
const calculation = args.join(' ')
.replace(/pi|Ļ€/gi, PI)
.replace(/random|RANDOM/gi, ann)
.replace(/x|X/gi, x)
.replace(/\bsqrt\b/gi, Math.sqrt);

const PI = Math.PI;
const ann = Math.floor(Math.random() * 100) + 1;
const x = '50'
const sqr = Math.sqrt


// Remplacement des occurrences de 'pi' ou 'Ļ€' par la valeur de PI
const calculation = args.join(' ')
.replace(/pi|Ļ€/gi, PI)
.replace(/random|RANDOM/gi, ann)
.replace(/x|X/gi, x)
.replace(/\bsqrt\b/gi, Math.sqrt);

monbrey
monbreyā€¢10mo ago
This isn't discord.js related
mushtaq
mushtaqā€¢10mo ago
what do you need help with also Math.sqrt is a method you forgot to add ()
./u.7-z
./u.7-zOPā€¢10mo ago
I would like to add the sqrt but it doesn't work
monbrey
monbreyā€¢10mo ago
I really dont understand what you're doing And it still has nothing to do with discord.js
./u.7-z
./u.7-zOPā€¢10mo ago
well t's in the discord.js code but
Mortai
Mortaiā€¢10mo ago
how in the hell do you add a method to a number šŸ¤” :thinkLul: why are you adding math.sqrt?? math.sqrt is the method to get the square root of a number?
Want results from more Discord servers?
Add your server