# How to adjust numbers in the journal with Emacs Calc

**URL:** <https://forum.plaintextaccounting.org/t/how-to-adjust-numbers-in-the-journal-with-emacs-calc/608>\
**Category:** General\
**Tags:** emacs\
**Created:** [August 1, 2025, 10:25am UTC](https://forum.plaintextaccounting.org/t/how-to-adjust-numbers-in-the-journal-with-emacs-calc/608 "2025-08-01T10:25:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonmic](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/simonmic/32/1_2.png) [@simonmic](https://forum.plaintextaccounting.org/u/simonmic)\
**Post date:** [August 1, 2025, 10:25am UTC](https://forum.plaintextaccounting.org/t/how-to-adjust-numbers-in-the-journal-with-emacs-calc/608/1 "2025-08-01T10:25:45Z")

</div>

Emacs users, you can use Calc’s embedded mode to adjust numbers quickly while editing the journal. Eg, to divide a number by 2, put the cursor in it, then press `C-x * w 2 / q`.

Calc rewrites decimal numbers to a standard format, hiding trailing zeros by default, which you may not want. To preserve trailing zeros, you must force a fixed number of decimal digits. In calc mode (eg before pressing q above) do:

- `d f 2 return` to force two digits (eg shows .00)
- `d f 3 return` to force three digits (eg shows .005 when there's a half cent)
- `d n` to choose normal mode (shows all digits except trailing zeros)

And to ensure that such config changes are saved in (and reloaded from) ~/.emacs.d/calc.el rather than the current buffer, add this to your emacs config:

```lisp
(setq calc-mode-save-mode 'save)

```

From [https://hledger.org/editors.html](https://hledger.org/editors.html)
