Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using multiple formulae in one table

I've got a table with multiple floating point rows and I'd like to round each of them.

+------------+-------------|
| 445.211219 | 1679.315626 |
| 415.789521 | 1566.561511 |
| 435.918622 | 1689.427872 |
+------------+-------------|
| 424.203660 | 1592.293310 |
| 400.164057 | 1628.415460 |
| 410.473361 | 1507.498568 |
+------------+-------------|
| 463.528003 | 1593.778433 |
| 459.144001 | 1487.695008 |
| 338.498464 | 1459.291475 |

So my first approach was

#+TBLFM: $3=round($3) $4=round($4)

But that produces

+----+-------------|
|  0 | 1679.315626 |
|  0 | 1566.561511 |
|  0 | 1689.427872 |
+----+-------------|
|  0 | 1592.293310 |
|  0 | 1628.415460 |
|  0 | 1507.498568 |
+----+-------------|
|  0 | 1593.778433 |
|  0 | 1487.695008 |
|  0 | 1459.291475 |

Two lines

#+TBLFM: $3=round($3)
#+TBLFM: $4=round($4)

doesn't work either - only the first one is applied.

How do I define formulae for more than one column?

like image 422
Reactormonk Avatar asked Apr 26 '26 14:04

Reactormonk


1 Answers

The formulas are ::-separated. Try :

#+TBLFM: $3=round($3)::$4=round($4)

You may want to use these commands from the manual to edit formulas, rather than editing the TBLFM line by hand, they're very convenient :·)

like image 60
Nikana Reklawyks Avatar answered Apr 30 '26 22:04

Nikana Reklawyks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!