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

56
Vistas
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 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