/ Published in: JavaScript
Convert str to float;
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function strToFloat(s) { try { return parseFloat(s.replace(",00", "").replace(/\s+/g, "").replace(" ", "").replace(",", ".")); } catch (e) { return 0; } }