Add math.sqrt in a calc command

9 Replies
d.js toolkit
d.js toolkitā€¢5mo 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
REGARDE MON STATUT
REGARDE MON STATUTā€¢5mo 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ā€¢5mo ago
This isn't discord.js related
mushtaq
mushtaqā€¢5mo ago
what do you need help with also Math.sqrt is a method you forgot to add ()
REGARDE MON STATUT
REGARDE MON STATUTā€¢5mo ago
I would like to add the sqrt but it doesn't work
monbrey
monbreyā€¢5mo ago
I really dont understand what you're doing And it still has nothing to do with discord.js
REGARDE MON STATUT
REGARDE MON STATUTā€¢5mo ago
well t's in the discord.js code but
Mortai
Mortaiā€¢4mo 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
More Posts