Subversion Repositories SmartDukaan

Rev

Rev 23783 | Rev 23819 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23783 Rev 23786
Line 36... Line 36...
36
	   cache: false,
36
	   cache: false,
37
	   data: params,
37
	   data: params,
38
       //dataType:'json',
38
       //dataType:'json',
39
	   type: httpType,
39
	   type: httpType,
40
	   success: function(response) {
40
	   success: function(response) {
41
	      //console.log("response"+JSON.stringify(data));
-
 
42
	      callback_function(response);
41
	      callback_function(response);
-
 
42
	      $('.currency').each(function(index,ele){
-
 
43
	    	  if(!isNaN(parseInt($(ele).html()))) {
-
 
44
	    		  $(ele).html(numberToComma($(ele).html()));  
-
 
45
	    	  }
-
 
46
	      });
43
	   }
47
	   }
44
	});
48
	});
45
}
49
}
46
 
50
 
47
function doGetAjaxRequestWithParamsHandler(urlString, params, callback_function){
51
function doGetAjaxRequestWithParamsHandler(urlString, params, callback_function){
Line 62... Line 66...
62
       contentType:'application/json',
66
       contentType:'application/json',
63
	   type: httpType,
67
	   type: httpType,
64
	   success: function(response) {
68
	   success: function(response) {
65
	      //console.log("response"+JSON.stringify(data));
69
	      //console.log("response"+JSON.stringify(data));
66
	      callback_function(response);
70
	      callback_function(response);
-
 
71
	      $('.currency').each(function(index,ele){
-
 
72
	    	  if(!isNaN(parseInt($(ele).html()))) {
-
 
73
	    		  $(ele).html(numberToComma($(ele).html()));  
-
 
74
	    	  }
-
 
75
	      });
67
	   }
76
	   }
68
	});
77
	});
69
}
78
}
70
 
79
 
71
function doPostAjaxRequestWithJsonHandler(urlString, json, callback_function){
80
function doPostAjaxRequestWithJsonHandler(urlString, json, callback_function){
Line 81... Line 90...
81
	   url: urlString,
90
	   url: urlString,
82
	   async: true,
91
	   async: true,
83
	   cache: false,
92
	   cache: false,
84
	   type: httpType,
93
	   type: httpType,
85
	   success: function(response) {
94
	   success: function(response) {
86
	      //console.log("response"+JSON.stringify(data));
-
 
87
	      callback_function(response);
95
	      callback_function(response);
-
 
96
	      $('.currency').each(function(index,ele){
-
 
97
	    	  if(!isNaN(parseInt($(ele).html()))) {
-
 
98
	    		  $(ele).html(numberToComma($(ele).html()));  
-
 
99
	    	  }
-
 
100
	      });
88
	   }
101
	   }
89
	});
102
	});
90
}
103
}
91
 
104
 
92
function doGetAjaxRequestHandler(urlString, callback_function){
105
function doGetAjaxRequestHandler(urlString, callback_function){
Line 261... Line 274...
261
	
274
	
262
}
275
}
263
 
276
 
264
 
277
 
265
function numberToComma(x) {
278
function numberToComma(x) {
-
 
279
	x=parseInt(x);
266
	x=x.toString();
280
	x=x.toString();
267
	var lastThree = x.substring(x.length-3);
281
	var lastThree = x.substring(x.length-3);
268
	var otherNumbers = x.substring(0,x.length-3);
282
	var otherNumbers = x.substring(0,x.length-3);
269
	if(otherNumbers != '')
283
	if(otherNumbers != '')
270
	    lastThree = ',' + lastThree;
284
	    lastThree = ',' + lastThree;
271
	return otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
285
	return otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
272
}
-
 
273
286
}
-
 
287