Hello @pureswing,
The equation’s code would be:
(function(){
var result = IF(fieldname4, FLOOR(fieldname2/fieldname4), '');
jQuery('.equation-result').html(result);
return result;
})();
Please, remember that javascript os case sensitive language.
If the issue persists, please, send me the link to your webpage for checking it in detail.
Best regards.
great, it works, that was fast 🙂 THX !!! ..by the way I found another small problem with a simple division in another field:
fieldname22 = 230
fieldname26 = 7
CF = 233 / 7 = 32.8571428…..
Using prec():
prec(fieldname22/fieldname26,2) = 32.86 which it’s not good, that field has to be consistent with 2 decimals without rounding, in other words I need a 32.85. Any solution around this??
Sorry for bothering you again my friend..
Regards
Hello @pureswing,
PREC(X,Y) “rounds” the X number with Y decimal places. If you want simply truncate the decimal places, the solution would be pure mathematics:
FLOOR(n*100)/100
For example, using your current equation:
FLOOR(fieldname22/fieldname26*100)/100
and replacing the values:
FLOOR(230/7*100)/100 =
FLOOR(32.857142857142854*100)/100 =
FLOOR(3285.7142857142854)/100 =
3285/100 = 32.85
I’m sorry, but the support service does not cover the implementation of the users’ projects (forms or formulas). If you need additional support implementing your project, I can offer you a custom coding service from my private website:
https://cff.dwbooster.com/customization
Best regards.