Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

288
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda