Re: [O] rounding (up)

2017-06-23 Thread Uwe Brauer
> Uwe Brauer writes: > (info "(calc) Integer Truncation") has > So I suggest the following: > | 3.25 | | > | 6.5 | | > #+TBLFM: $2=round($1*0.15,2);%.2f That is cool as well

Re: [O] rounding (up)

2017-06-22 Thread Uwe Brauer
>>> "John" == John Kitchin writes: > #+BEGIN_SRC emacs-lisp > (list (custom-round 0.4875 2 'floor) (custom-round 0.975 2 'floor)) > #+END_SRC Thanks I will have a look into that code.

Re: [O] rounding (up)

2017-06-22 Thread Marco Wahl
Uwe Brauer writes: > Hi > > It seems that org-table (and the underlying calc implementation) round > down not up. > > > Please consider > > | 3.25 | 0.4875 | > | 6.5 | 0.975 | > > #+TBLFM: $2=$1*0.15; > > > | 3.25 | 0.49 | > | 6.5 | 0.97 | > > #+TBLFM: $2=$1*0.15;%.2f > > Is there a way to obt

Re: [O] rounding (up)

2017-06-22 Thread John Kitchin
It appears Emacs uses Banker's rounding (http://wiki.c2.com/?BankersRounding): #+BEGIN_SRC emacs-lisp (list (round 4.5) (round 5.5)) #+END_SRC #+RESULTS: | 4 | 6 | Here is some lightly tested code to get different styles of rounding: #+BEGIN_SRC emacs-lisp (defun custom-round (number &optional

[O] rounding (up)

2017-06-22 Thread Uwe Brauer
Hi It seems that org-table (and the underlying calc implementation) round down not up. Please consider | 3.25 | 0.4875 | | 6.5 | 0.975 | #+TBLFM: $2=$1*0.15; | 3.25 | 0.49 | | 6.5 | 0.97 | #+TBLFM: $2=$1*0.15;%.2f Is there a way to obtain | 3.25 | 0.49 | | 6.5 | 0.98 | #+TBLFM: $2=$1*0