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

184
Visualizações
Regular expression for dynamic replacement of the entered time

Please help me make a regular expression (JS) with the following conditions

  • enter a number in the field <= 24
  • you can enter the decimal part separated by a dot (14.6, 3.4, 1, 3)
  • the number must be rounded to one decimal place (23.45 -> 23.4, 1.42 -> 1.4, 1.27 -> 1.3)
  • if the entered number is greater than 24, the number is replaced by the maximum (24)
  • if the number is entered incorrectly, it is immediately replaced by correct

Here is my attempt to do something

/(^\d|1\d|2[0-4]|(^\d|1\d|2[0-3])\.\d)$/gm;
about 4 years ago · Juan Pablo Isaza
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