Hacker News new | ask | show | jobs
by djd 4889 days 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?
1 comments

You can get decent float parsing by doing Number() casting / regex cleanup, instead of parseFloat(). I don't know how tangle does it though
Right, 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.)