Archive for May, 2013

Javascript money format

Number.prototype.moneyformat = function(decPlaces, thouSeparator, decSeparator) {
	var n = this,
	sign = n < 0 ? "-" : "",
	i = parseInt(n = Math.abs(+n || 0).toFixed(decPlaces),10) + "",
	j = (j = i.length) > 3 ? j % 3 : 0;
	return sign + (j ? i.substr(0, j) + thouSeparator : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thouSeparator) + (decPlaces ? decSeparator + Math.abs(n - i).toFixed(decPlaces).slice(2) : "");
};

usage:

var myMoney=3543.75873;
var formatedMoney = myMoney.moneyformat(2,'.',',') + ' EUR';

Tags: , ,

What is listen on my apache port?

On Windows it seems not to be that easy figure out if some process is listening on port 80 or 443.
A simple command line command can show the pid of the process that is listening.

netstat -ano | findstr /R 0.0:80 && netstat -ano | findstr /R 0.0:443

Easy ;)

Tags:

Archives by Subject:

Archives by Month: