This function is returning error: NaN, to convert back to text.
function floatToMoneyText(value) {
var text = (value < 1 ? "0" : " ") + Math.floor(value * 100);
text = "R$ " + text;
return text.substr(0, text.length - 2) + "," + text.substr(-2);
}
Here is the link: link