Re:Fangle - reactive text generation from markdown
by djd on Thursday January 24, 2013 @02:29AM
(#5108196)
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?
[ Parent
| on HN ]
Re:Fangle - reactive text generation from markdown
by jasonm23 on Thursday January 24, 2013 @05:01AM
(#5108703)
You can get decent float parsing by doing Number() casting / regex cleanup, instead of parseFloat(). I don't know how tangle does it though
Re:Fangle - reactive text generation from markdown
by jotux on Thursday January 24, 2013 @02:58PM
(#5111805)
I'm using this js sprintf library: http://www.diveintojavascript.com/projects/javascript-sprint...
Re:Fangle - reactive text generation from markdown
by jasonm23 on Friday January 25, 2013 @05:36AM
(#5114860)
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.)