emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [bug] Assigning "0:00" to cell gives an error


From: Sebastien Vauban
Subject: Re: [O] [bug] Assigning "0:00" to cell gives an error
Date: Wed, 02 May 2012 11:30:46 +0200
User-agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.1.50 (windows-nt)

Hi Bastien,

Bastien wrote:
> "Sebastien Vauban" writes:
>
>> We can assign the value "0:00" to a cell via the string function:
>>
>> | Task    | HH:MM |
>> |---------+-------|
>> | This    |  1:23 |
>> | Nothing |  0:00 |
>> | That    |  4:56 |
>> #+TBLFM: @2$2=1:23::@3$2=string("0:00")::@4$2=string("4:56")
>>
>> but, *when giving the value via the table formula*
>>
>> - we can't convert any time (0:00 or H:MM) to a fractional time:
>>
>>   | Task    | HH:MM |
>>   |---------+-------|
>>   | This    | 0.00  |
>>   | Nothing | na    |
>>   | That    | na    |
>>   #+TBLFM: @2$2=1:23;t::@3$2=string("0:00");t::@4$2=string("4:56");t
>
> The :t and :T flags are not assigning a value to a cell.

I did not express myself clearly, then. Sorry for that.

The assignment is done through the `=' sign. This is the "what" part of the
equation, that is the value which is assigned to the cell.

The flags are the "how" part of the assignment. At least, they should tell
about the formatting of the value (like for numeric assignments), but they
don't (for time assignments).

Let's compare with numerics:

  @2$2=3.141592;%.2f

The value just follows the equal sign: pi is *what* to output in the cell. The
flag (here, `%.2f') says *how* to output it, in this case limited to 2
decimals.

Let's come back to time values:

  @2$2=1:23;t

means, for me, that:

- the value 1:23 should be assigned to the cell
- that value should be formatted as a fraction.

Hence, I'd expect to see `1.38' (and not `0:00').

>> - we can't confirm that its format must be H:MM
>>
>>   | Task    | HH:MM |
>>   |---------+-------|
>>   | This    | 0:00  |
>>   | Nothing | na    |
>>   | That    | na    |
>>   #+TBLFM: @2$2=1:23;T::@3$2=string("0:00");T::@4$2=string("4:56");T
>
> ... same here.
>
>> Those problems do arise in both ways of assigning a time to a cell:
>>
>> - via the "common" way:  @2$2=1:23
>>
>>   Results: 0.00
>>
>> - via the "string" function:  @4$2=string("4:56")
>
> The @4$2=string("4:56") works fine here, without any flag.

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

[Prev in Thread] Current Thread [Next in Thread]