[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: readnumber patch
From:       Nicolas Goutte <nicog () snafu ! de>
Date:       2002-05-16 19:16:19
[Download RAW message or body]

On Thursday 16 May 2002 08:15, David Faure wrote:
> On Thursday 16 May 2002 03:12, John Dailey wrote:
> > Does anyone see a problem with committing this patch for klocale.cpp?
> >
> > Currently it doesn't parse scientific notation that doesn't include a
> > decimal point -- "2.0E-10" works but "2E-10" doesn't.  What it does parse
> > correctly is purely by accident.
>
> Yes - I'm not surprised, since I didn't think of that notation when last
> hacking readNumber (long ago).
> Actually.... maybe that's because it was parsed in KSpread itself,
> before calling readNumber?
>
> > My change looks for the 'E' (or 'e') and preserves
> > that part of the string for when it is sent to QString::toDouble
>
> Looks good.
>
> > I don't see how this can break anything, but I'm not really familiar with
> > using different locales so I want to see if anybody has a problem with
> > it.
>
> Good question. I don't know if any locale has another way of writing down
> the scientific notation. But since KSpread assumes the same, someone would
> have raised his/her voice by now, I would assume ;)

Just a question: what happens if the locale has a decimal comma instead of a 
decimal point?

>
> This raises the question of whether readNumber should deal with
> such notations though. Makes sense for KSpread, but not for e.g. knuminput
> etc. (ok one can't type 'e' in it, I suppose, but still ;).
> A little typo in a lineedit could turn 19 into 1e9, which is much bigger ;)
>
> Just some thoughts.

Have a nice day/evening/night!
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic