Re: strange behavior for float numbers

2009-03-04 Thread Tony Paul
Thank you Alan. The numbers I want to display, come from a file, to the server, then the server sends those numbers to GWT. So I don't have control generating the numbers as rational numbers. The solution that worked for me is to read the numbers on the server as double, then send them to GWT. GWT

Re: strange behavior for float numbers

2009-02-26 Thread Felipe Cypriano
What about using this kind of rounding: var decimals = 2; var result = Math.round(number * Math.pow(10, dec)) / Math.pow(10, dec); Any problems with this approach? --- Felipe Marin Cypriano Vitória - ES http://www.linkedin.com/in/felipecypriano On Wed, Feb 25, 2009 at 12:50 PM, Alan Hadsell w

Re: strange behavior for float numbers

2009-02-25 Thread Alan Hadsell
On Feb 24, 1:52 pm, "tony.p.." wrote: > This seems like a bug in JS, more than just the way it handles float. > Because I'm not doing any calculations on the GWT (JS) side, I'm just > printing what comes from the server. So if 15.2 if printed as > 15.20, that would be ok, but to be pri

Re: strange behavior for float numbers

2009-02-24 Thread tony.p..
don't want it to vary, try something like gwt- > math -http://code.google.com/p/gwt-math/. > > On Feb 24, 9:52 am, "tony.p.." wrote: > > > Hello everyone, > > > I'm getting strange behavior for float numbers. I'm processing data on > > the serve

Re: strange behavior for float numbers

2009-02-24 Thread Charlie Collins
eb 24, 9:52 am, "tony.p.." wrote: > Hello everyone, > > I'm getting strange behavior for float numbers. I'm processing data on > the server, reading it from a file. The data consists of strings, > floats and integers. I read them all as Strings, then process their >

strange behavior for float numbers

2009-02-24 Thread tony.p..
Hello everyone, I'm getting strange behavior for float numbers. I'm processing data on the server, reading it from a file. The data consists of strings, floats and integers. I read them all as Strings, then process their actual values. Then when I display them, on the GWT client, via