// $Id: I18N.js,v 1.1.1.1 2009/04/02 00:08:57 cmanley Exp $

var I18N = new (function() {
	this.language = 'nl';
	this.mon_thousands_sep = ' ';
	this.mon_decimal_point = ',';
	this.thousands_sep = '';
	this.decimal_point = ',';
	this.formatCurrency = function(value) {
		var f = Math.round(value * 100);
		if (f == 0) {
			return '0' + this.mon_decimal_point + '00';
		}
		var s = String(f);
		var e = s.length > 2 ? s.substr(0,s.length - 2) : '0';
		var c = s.substr(s.length - 2);
		var re = /(\d+)(\d{3})/;
		while (re.test(e)) {
			e = e.replace(re, '$1' + this.mon_thousands_sep + '$2');
		}
		return e + this.mon_decimal_point + c;
	}
})();

if (!Number.prototype.toCurrency) {
	Number.prototype.toCurrency = function() {
		return I18N.formatCurrency(this);
	}
}
if (!String.prototype.toCurrency) {
	String.prototype.toCurrency = function() {
		return Number(this).toCurrency();
	}
}

