/**
 * Default modifiers to use in templates,
 * these functions can be used outside the context of templates as well
 */

pH8.modifiers = {
	/**
	 * format the price with 2 decimals
	 * @param {Object} str
	 */
	formatPrice: function(str){
		str = String(Math.round(parseFloat(str)*100)/100);
		if (str.indexOf('.') == 0) {
			str += '.00';
		}
		else if (str.indexOf('.') == str.length - 2) {
			str += '0';
		}
		return str.replace('.', ',').replace(',00', ',-');
	}
}


if(TrimPath.parseTemplate_etc.modifierDef){
	TrimPath.parseTemplate_etc.modifierDef = Object.extend(TrimPath.parseTemplate_etc.modifierDef, pH8.modifiers);
}

