Arithmetic Code Error
-
Hello;
I added a [Text Area]- [fieldname37] field, users enter random numbers in the form of 1,6,9,8.I also want to calculate the arithmetic average of the digits entered with the code below.
I think I’m making a mistake somewhere in the code, any suggestions?(function() { var inputValues = jQuery('[name="fieldname37"]').val(); var numbers = inputValues.split(',').map(parseFloat); var sum = numbers.reduce((total, num) => total + num, 0); var count = numbers.length; var arithmetic= sum / count; jQuery('#calculation-kriter3').html(arithmetic); jQuery('.arithmetic-aciklama').html('Arithmetic : '); jQuery('.arithmetic-sonuc').html(arithmetic); return [arithmetic]; })();
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Arithmetic Code Error’ is closed to new replies.