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

List:       koffice-devel
Subject:    Re: [kspread] KSpreadValue class
From:       Ariya Hidayat <ariya () kde ! org>
Date:       2002-09-16 22:18:02
[Download RAW message or body]


> But I miss the date and time type in this enum here:
> ...
> I don't want to use QDateTime anymore but doubles (like Gnumeric/Excel). So
> I just take the double, grep the format string and format the
> date/time/number. If I knew it is a meant to be time and not a normal
> number it would be a little bit easier, because I do not have to decide by
> looking at the format string what kind of data it is.

Hmm I still didn't get exactly what you mean. Here is a bit more detailed 
explanation. KSpreadValue doesn't store date/time, however it can convert 
date/time into double/floating-point serial number and vice versa.
If you run:
   KSpreadValue val;
   val.setValue ( <some date/time variable> ).
there's no way you can know the val holds a date/time serial number or a real 
floating-point value because it just converts that date/time into 
serial-number.

In addition, I don't see why we need this. A formatting system deals with how 
to display the data. If the value is an integer and the format is scientific, 
then display it with exponention format. If the value is an integer but the 
format is date, then display the date/time corresponding to the integer 
(which is assumed to be the serial number).

Excel, however, behaves a little bit intelligent. If user enters date/time, it 
stores the value of serial number representing the date/time and at the same 
time automatically 'adjust' the format to date/time. If user enters a formula 
which returning date/time (like TODAY), again the format of this cell is 
'adjusted' to date/time.


_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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