Subversion Repositories SmartDukaan

Rev

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

Rev 25093 Rev 25144
Line 365... Line 365...
365
function numberToComma(x) {
365
function numberToComma(x) {
366
 
366
 
367
	x = x.toString();
367
	x = x.toString();
368
	x = x.split('.');
368
	x = x.split('.');
369
	var x1 = x[0];
369
	var x1 = x[0];
370
	var x2 = x.length > 1 ? '.' + x[1] : '';
370
	var x2 = x.length > 1 && x[1]!='0'? '.' + x[1] : '';
371
	var lastThree = x1.substring(x1.length - 3);
371
	var lastThree = x1.substring(x1.length - 3);
372
	var otherNumbers = x1.substring(0, x1.length - 3);
372
	var otherNumbers = x1.substring(0, x1.length - 3);
373
	if(x1.charAt(x1.length-4)==',' || x1.charAt(x1.length-4)=='-'){
373
	if(x1.charAt(x1.length-4)==',' || x1.charAt(x1.length-4)=='-'){
374
	console.log(lastThree)
374
		console.log(lastThree)
375
	}
375
	}
376
	else{
376
	else{
377
	if (otherNumbers != '')
377
	if (otherNumbers != '')
378
		lastThree = ',' + lastThree;
378
		lastThree = ',' + lastThree;
379
	}
379
	}