Hi there. A friend of mine needs to know (me too, indeed) how to do this:
she has an app where do a little math: sum 1.5+1.3=2.5
but, she wants 2,5 as a correct answer too...in fact, any value whith a comma in it... i think the . has to be recognized and changed to , or viceversa...but we dont know the syntax...
String.prototype.replace = function(s,r){//s is the substring you're looking for//r is what you want to replace it withvar a = this.split(s);
return a.join(r);
}
myDodgyNum = "2,5";
myNiceNum = myDodgyNum.replace(',','.');