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

59
Visualizações
Add two fields together

I have this code with two fields, but I need the first and second math calculation in the same field, but when I used if, only the first still making the multiplication and division won't work in the second field:

field 1:

      {
    field: ["volumeWater", "volumeBasc"],
    updates: (
      value,
      name,
      { volumeWater, volumeBasc}
    ) => {
      const changes= {};

      if (volumeBasc&& volumeWater) {
        const qtdBascAwait = (
          volumeWater/ volumeBasc
        ).toFixed(1);
        changes["volumeWaterMeasure"] = (
          volumeWater* 0.025
        ).toPrecision(8);
        
      }
      return changes;
    },
  },

And this is the second field:

     {
    field: [
     
      "volumeWaterMeasure",
    ],
    updates: (value, name, {  volumeBasc, volumeWaterMeasure}
      ) => {
      const mudancas = {};

      if (volumeWaterMeasure && volumeBasc) {
       //  const erro = (
       //    volumeWaterMeasure/ volumeBasc
       //  ).toFixed(1);
        
        changes["volumeWater"] = (
          volumeWaterMeasure/ 0.025
        ).toPrecision(8);

      }

      return changes;
    },
  },

0

I need the the first and secound math calculation in the same field, but when I used if, only the first still making the multiplication and division won't work in the secound field

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