var priceTool = {};
priceTool.tested = false;

priceTool.toDot = function(nStr) { // 1.500,75 => 1500.75
    nStr = nStr.replace(".", "","g"); // strip thousands seperators
    nStr = nStr.replace(",", "."); // replace comma with dot for decimal
    return nStr;
}

priceTool.toComma = function(nStr) { // 1,500.75 => 1500,75
    nStr = nStr.replace(",", "","g"); // strip thousands seperators
    nStr = nStr.replace(".", ","); // replace dot with comma for decimal
    return nStr;
}

priceTool.selfTest = function() {
    if( (this.toDot("1.500.500,75") == "1500500.75") && (this.toComma("1,500,500.75") == "1500500,75") ) {
        return true;
    } else {
        return false;
    }
}

priceTool.tested = priceTool.selfTest();

