4 ms·
Not a JS/Programming Pro here so please pardon my ignorance. One major problem faced by me in JavaScript is the weird handling of floats. This kind of applicati
by djd 14y ago
Not a JS/Programming Pro here so please pardon my ignorance. One major problem faced by me in JavaScript is the weird handling of floats. This kind of application will end up dealing with floats. How should I avoid errors? or does Tangle itself handle the conversions?
- jasonm23 14y agoYou can get decent float parsing by doing Number() casting / regex cleanup, instead of parseFloat(). I don't know how tangle does it though
- jotux 14y agoI'm using this js sprintf library: http://www.diveintojavascript.com/projects/javascript-sprintf http://www.diveintojavascript.com/projects/javascript-sprint...
- jasonm23 14y agoRight, yeah I use this one too for anywhere I need printf a-like formatting in JS. But isn't this the other side of the coin? Formatting numbers as strings, not parsing strings to floats? (forgive me if I'm off base on this, I'm only looking sideways at this right now.)