jQuery map is returning : data:["1", "8", "5", ".", "9", "0"] when the input val is 185.90 – why the value is being splited?
The code:
var $cel = $.map(
$('td:nth-child(' + (i + 2) + ') input').each(function() {
$(this).val();
}).val(), function(value) {
return value;
);
return {
data: $cel
};
.val()returns thevalueof the first matched element. And thatvalueis astring,or in other words array of chars.That is why, you are iterating through the chars of thevalue‘s string.Probably, you want this: