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