@mark that's not true... And different platform do different things... There are many definitions of rounding. Not just the one taught in school...just look at the difference between the rounding in python 2.7 and python 3.x
Here's a fun link for ya... http://www.mathsisfun.com/numbers/rounding-methods.html > When you store and then retrieve the number 0.3, you'd really like to know that it will come back in the same form. Without knowing about the innards of CouchDb and how it processes JSON, that's hard to guarantee. A JS number is the same whether going through JSON or not. There is no possible change. Storing the number 0.3 is no more of a problem in JS than storing 0.3 in C, JAVA, or anywhere else. They teach that in programming 101. On Fri, Nov 15, 2013 at 9:25 AM, Nick North <nort...@gmail.com> wrote: > Absolutely. I've built live accounting systems both with and without > decimals. You can sort of get by without them, but you'll always lose > accuracy somewhere, or have to do rounding in places where you really > shouldn't, and wish you had them. > > When you store and then retrieve the number 0.3, you'd really like to know > that it will come back in the same form. Without knowing about the innards > of CouchDb and how it processes JSON, that's hard to guarantee. > > > On 15 November 2013 17:18, Robert Newson <rnew...@apache.org> wrote: > > > "You just need to round at the appropriate points in your code." > > > > Not accounting software I'd want to use. > > > > B. > > > > > > On 15 November 2013 17:00, Mark Hahn <m...@reevuit.com> wrote: > > > Numbers are 100% supported in JSON and JavaScript. You would never > have > > a > > > problem using real numbers. I don't know where you picked up that > myth. > > > > > > BTW, It's also a myth that you can't do accounting in JS. JS number > have > > > 52 real bits. You just need to round at the appropriate points in your > > > code. > > > > > > > > > On Fri, Nov 15, 2013 at 8:56 AM, Nick North <nort...@gmail.com> wrote: > > > > > >> On 15 November 2013 16:28, Mark Hahn <m...@reevuit.com> wrote: > > >> > > >> > > I store the numbers as strings because I read this the proper way > > for > > >> > decimals. > > >> > > > >> > Where did you read this? That makes no sense. > > >> > > > >> > > > >> If your numbers are going to pass through JSON and JavaScript, then > I'd > > say > > >> it's reasonable. There are sufficient unknowns with JSON parsers and > > >> serialisers and processing engines along the way that storage as > strings > > >> feels the safest thing to do. > > >> > > >> Nick > > >> > > >