Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

54
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!