
# precision-mode.el: Change format of data with uncertainties

This simple emacs minor mode helps converting numerical values with
uncertainties between human readable and computer readable formats. It
acts on regions of text, changing between the computer readable format
```
2.885701E+00 +/- 1.1368E-02
2.896314E+00 +/- 3.8201E-02
```
and the human readable format
```
2.886(11)
2.896(38)
```


## Install

Just copy the file `precision-mode.el` with the rest of your emacs
configuration files and add tou your `.emacs` file
```
(precision-mode)
```

## Usage

At the moment the mode has some very simple features
- `M-x prec-pm-to-paren`: Transforms values in the format 
`value +/- error` into the human readable `value(error)`.
- `M-x prec-paren-to-pm`: Performs the inverse transformation. 

The variable `prec-ndigits` contains the number of significant digits
for the errors (default: 2). If you prefer a different formatting
option change the value with (i.e. `(setq prec-ndigits 3)`) before
loading the minor mode. 

## Screencast

This screencast shows one of the most frequent uses. Some text output
from an analysis code is transformed to human readable format by
`precision-mode`. Together with `orgtbl-mode` the data can be easily
exported to a `LaTeX` file. 

![Screencast](screencast/precision-mode.gif)

## License

```
"THE BEER-WARE LICENSE":
Alberto Ramos wrote this file. As long as you retain this 
notice you can do whatever you want with this stuff. If we meet some 
day, and you think this stuff is worth it, you can buy me a beer in 
return. <alberto.ramos@cern.ch>
```


