emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug] Assigning "0:00" to cell gives an error
@ 2012-03-20 13:59 Sebastien Vauban
  2012-03-20 14:06 ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2012-03-20 13:59 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

As shown by this example, we can't assign the value "0:00" to a cell:

| Task    |  HH:MM |
|---------+--------|
| This    |   1:23 |
| Nothing | #ERROR |
| That    |   1:23 |
#+TBLFM: @2$2=1:23::@3$2=0:00::@4$2=4:56

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bug] Assigning "0:00" to cell gives an error
  2012-03-20 13:59 [bug] Assigning "0:00" to cell gives an error Sebastien Vauban
@ 2012-03-20 14:06 ` Carsten Dominik
       [not found]   ` <095A94F6-D2B9-40BE-BF04-79F61A62BA02-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2012-03-20 14:06 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Hi Sebastien,

you can use @3$2=string("0:00")

- Carsten

On 20.3.2012, at 14:59, Sebastien Vauban wrote:

> Hello,
> 
> As shown by this example, we can't assign the value "0:00" to a cell:
> 
> | Task    |  HH:MM |
> |---------+--------|
> | This    |   1:23 |
> | Nothing | #ERROR |
> | That    |   1:23 |
> #+TBLFM: @2$2=1:23::@3$2=0:00::@4$2=4:56
> 
> Best regards,
>  Seb
> 
> -- 
> Sebastien Vauban
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bug] Assigning "0:00" to cell gives an error
       [not found]   ` <095A94F6-D2B9-40BE-BF04-79F61A62BA02-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-04-30 14:47     ` Sebastien Vauban
  2012-05-01 16:39       ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2012-04-30 14:47 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi,

Carsten Dominik wrote:
> On 20.3.2012, at 14:59, Sebastien Vauban wrote:
>> 
>> As shown by this example, we can't assign the value "0:00" to a cell:
>> 
>> | Task    |  HH:MM |
>> |---------+--------|
>> | This    |   1:23 |
>> | Nothing | #ERROR |
>> | That    |   1:23 |
>> #+TBLFM: @2$2=1:23::@3$2=0:00::@4$2=4:56
>
> you can use @3$2=string("0:00")
>
> - Carsten

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

- 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

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")

  Results: org-table-time-seconds-to-string:
  Wrong type argument: stringp, (0 "Number expected")

  (I've explicitly written "na" strings which never got replaced, because of
  this error)

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bug] Assigning "0:00" to cell gives an error
  2012-04-30 14:47     ` Sebastien Vauban
@ 2012-05-01 16:39       ` Bastien
  2012-05-02  9:30         ` Sebastien Vauban
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2012-05-01 16:39 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hi Sébastien,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> 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.  

> - 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.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bug] Assigning "0:00" to cell gives an error
  2012-05-01 16:39       ` Bastien
@ 2012-05-02  9:30         ` Sebastien Vauban
  2012-05-05 14:15           ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2012-05-02  9:30 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bug] Assigning "0:00" to cell gives an error
  2012-05-02  9:30         ` Sebastien Vauban
@ 2012-05-05 14:15           ` Bastien
  2012-06-04 14:58             ` Sebastien Vauban
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2012-05-05 14:15 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hi Sébastien,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> 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').

This works correctly now, thanks.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [bug] Assigning "0:00" to cell gives an error
  2012-05-05 14:15           ` Bastien
@ 2012-06-04 14:58             ` Sebastien Vauban
  0 siblings, 0 replies; 7+ messages in thread
From: Sebastien Vauban @ 2012-06-04 14:58 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Bastien,

Bastien wrote:
> "Sebastien Vauban" writes:
>
>> 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').
>
> This works correctly now, thanks.

I confirm that the above case works correctly now, as shown here:

| Task    | HH:MM |
|---------+-------|
| Foo     |  1:23 |
| Bar     |  1.38 |
| Nothing |  0:00 |
#+TBLFM: @2$2=1:23::@3$2=@2$2;t::@4$2=string("0:00")

Thanks.

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-06-04 14:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-20 13:59 [bug] Assigning "0:00" to cell gives an error Sebastien Vauban
2012-03-20 14:06 ` Carsten Dominik
     [not found]   ` <095A94F6-D2B9-40BE-BF04-79F61A62BA02-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-04-30 14:47     ` Sebastien Vauban
2012-05-01 16:39       ` Bastien
2012-05-02  9:30         ` Sebastien Vauban
2012-05-05 14:15           ` Bastien
2012-06-04 14:58             ` Sebastien Vauban

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).