Hi? need help
(function(){
var result = ”;
if( AND(fieldname2, fieldname3) ){
result = fieldname2/fieldname3;
jQuery(‘.text-here1’).html(‘To calculate the current in a section of a circuit using Ohm’s Law, we get a value of – ‘+result+’ A‘);
} else if( AND(fieldname2, fieldname40) ){
result = fieldname2/fieldname40;
jQuery(‘.text-here1’).html(‘To calculate the resistance in a section of the circuit using Ohm’s law, we get a value of – ‘+result+’ Ohms‘);
} else if( AND(fieldname3, fieldname40) ){
result = fieldname3*fieldname40;
jQuery(‘.text-here1’).html(‘To calculate the voltage in a section of the circuit using Ohm’s law, we obtain a value of – ‘+result+’ V‘);
}
return result;
})()
This code is inserted into the Field Type: Calculated Field.
This code returns the calculations and shows in Field Type: HTML content.
My calculation fields are hidden. When inserting ROUND(),0.0001) into this code, rounding occurs only in the calculated field, which is hidden from me, and visually we see non-rounded numbers. Is there any way to fix this?
In addition, calculations occur depending on the selection of data in the drop-down list. And when you select another variable to calculate from the drop-down list, the data is reset in the calculated field, and the HTML field is not reset, i.e. previous calculations are shown until new calculations are performed. Can this be fixed?