Pagefault We write about things, mostly programming related

You do know emacs can do that?

Recently I needed to convert hours, minutes and seconds into just seconds. The data I had was something like 3h 14min 40sec. I’ve recently been trying to wean myself off python as my primary calculator and been learning emacs calc.

So I fired up M-x calc and started putting in 3 RET 60 * 60 * blah blah, when a little corner in my brain suddenly remembered reading about units in calc. A quick C-h i m calc RET and a little bit of reading about units and I went back to calc.

In the calc buffer pressing ' will enter algebraic input mode here we can not only enter algebraic expressions (and find the value of variables in equations, but that’s for another post..) and units. Just enter 3hr+14min+40sec RET and the press u b (which converts to the base unit) and the answer of 11680 s will be there faster than you can say emacs rocks.

Another lesson confirmed: emacs is the original “there is an app for that”.

Now I only need to figure out how to get those 10 mins I spent reading back…