That's probably a low hanging fruit.
In short, what I want:
6.7690001 ---> 6.77
I know how to do it in org mode table using regular TBLFM:
|---------|
|6.7690001|
|---------|
#+TBLFM: @1$1=@1$1;%.2f
Moving pointer to the formula line and pressing C-c C-c
, results in:
|------|
| 6.77 |
|------|
#[pointer]+TBLFM: @1$1=@1$1;%.2f
The question now is: How to do exactly this using elisp code within the formula line?
|---------|
|6.7690001|
|---------|
#+TBLFM: @1$1='(???<elisp code>???)
Background:
I'm doing a complex calculation with an org mode table, switching formats multiple times within the process. That forces me to use elisp code within the formula line, pushing me out of my comfort zone. While developing the table I've noticed, that sometimes the calculation result is output in a weird format.
For example:
0.5+0.5=1.00000001, instead of 0.5+0.5=1
I'm curious why but have no clue why the output sometimes is like that, but I don't like it - and know how to fix it regularly, as mentioned. But in elisp code? There are just some things, I know to do regularly, but not when using elisp code.