I'm using SPServices to query a SharePoint 2010 list, a can get the values that I want but when I try to sum all of then I get this"
Here is the code that i use:
var TotalAmount = 0.00;
$().SPServices({
operation: "GetListItems",
async: false,
listName: {list guid},
viewName: {view guid},
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='AP' /><FieldRef Name='Amount' /></ViewFields>",
CAMLQuery: "<Query><Where><Eq><FieldRef Name='AP' /><Value Type='Text'>"+areaValue+"</Value></Eq></Where></Query>",
completefunc: function (xData, Status){
$(xData.responseXML).SPFilterNode("z:row").each(function(){
var liHtml=$(this).attr("ows_Title");
var app =$(this).attr("ows_AP");
Amount = $(this).attr("ows_Amount");
TotalAmount = TotalAmount + montante;
});
}
});
alert(TotalAmount);