Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

294
Views
If there is too many 9s after a certain point do something

So basically there is an issue with math js where id it has to do this equation 1:999 or anymore nines it will crash.

        try
        {
            if(args == "1:999") return message.channel.send('That question is not allowed');

        } catch(error){
            message.channel.send("there was an error")
        }

Right now if you have it calculate 1:999 it gives an error, but I want it instead to see if the equation has any more nines. ex if i did 1:9999999 it would also give an error but basically anything over with more than three nines in this equation will give an error.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

The following example shows a regular expression being used to test if a string is of the form "1:999", "1:9999", "1:99999", ...

if (/^1:999+$/.test(arg)) {
about 4 years ago · Juan Pablo Isaza Report

0

You can use the String#EndsWith to check if the string ends with the number of 9 you want using String#repeat

if (args.endsWith('9'.repeat(count))) {
  console.log("Too many nines");
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!