Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

292
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda