Show HN: I made a web-based notepad with a built in unit calculator (opens in a new tab)numpad.io
488 pointsHi HN
It also supports percentages, dates and variables.
I've been working on this alone for a few years now, so would love to get some feedback.
Comments (239) 97 threads
Show all comments
Showing thread 3 of 97
Even includes error handling :)
At the bottom you can see some test examples of what it can do. Obviously it is a basic calculator.
But to give you an idea of what that all looks like this is the code for the parser that parses the "as a % of" operator:
[0] https://github.com/bodil/eulalieI wasn't familiar with Eulalie, that's a really interesting approach. I built functionality [0] similar to numpad into a larger record-keeping system, Tap [1]. Precedence rules kindof scramble my brain so I ended up implementing s-expression syntax for Tap formulas.
I ended up writing the parser myself, called sowhat, but used a library for tokenization, moo.js [2]. You can see a demo of just the sowhat editor here [3].
0. https://www.tatatap.com/formulas 1. https://www.tatatap.com 2. https://github.com/no-context/moo 3. https://tatatap-com.github.io/sowhat-editor/