38 ms·
Show HN: I made a web-based notepad with a built in unit calculator
Hi 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.
- bflesch 4y agoFound an error: 20mm * 30mm * 7mm in m^3 -> incompatible units
- menthena 4y agohow do you do great work, bookmarked. "Share doc" is not clear imo. Why not "Save & Share"?
- dabedee 4y agoLooks awesome! Well done! It would be great to have a similar UI for LaTeX or maybe even a REPL. Cheers!
- argulane 4y agohttps://www.overleaf.com/ https://www.overleaf.com/ comes quite close
- ivolimmen 4y agoThis looks really useful for a quick calculation. Thanks for the bookmark!
- kiemrong08 4y agolove it, i bookmarked
- ttoinou 4y agoNice. Could this be done with a VS Code extension ?
- tonyonodi 4y agoI've never made a VS Code extension, but I think it would be possible; no plans to do so currently though.
- nudpiedo 4y agothere are several inline repl extensions, for many many programming languages. One of the first ones to do it was clojure, imitating the lighttable IDE. I believe you will find similar ones for other languages
- elcritch 4y agoLooks nice! Making the result blocks non-text is handy. Any plans to open source this or sell a desktop version? I've long been a fan of http://calca.io http://calca.io but it doesn't run on Linux. There's some other versions out there but they tend to be flaky.
- nudpiedo 4y agoWhy limit it to arithmetic? Looks much like the original idea behind lighttable IDE which is basically a REPL plugin that allows to evaluate certain lines within it. There are several similar projects around.
- tonyonodi 4y agoBecause Turing completeness scares me! I was a big fan of Light Table when it first came out and the developers behind it have gone on to do some really interesting things, but I want to keep this project more limited in scope for now.
- nudpiedo 4y agoCoding comes with the implicit responsibility over one’s mess. Everyone understands that hanging your computer for your own actions it’s own’s fault. That can be an issue if you provide a limitless cloud instance, but you can roll the ball to user’s roof with client a side engine, either JS or a local instance, depending your vision for such an app.
- nonoesp 4y agoI have a side project slightly similar to the functionality your tool offers focused on expense tracking (or other measures) over time, adding date parsing to the equation in order to plot metrics into a graph and with tags and locations for filtering.
- tonyonodi 4y agoNice! Can you send a link or is it still in development?
- nonoesp 4y agoHey! It's still in development. I built a proof-of-concept from scratch almost a year ago, which I just open-sourced at the following link. https://github.com/nonoesp/note-parser https://github.com/nonoesp/note-parser I intend to develop it a bit more and host it online. A previous prototype, really barebones, is at https://expensed.me https://expensed.me. The idea is to drag and drop (or type) a plain-text note and visualize the data as a scatterplot or other charts.
- Dries007 4y agoI'm (slowly) working on something that can eat up PSD2 data from banks and parse it into some usable data, but I'm bad at nicely presenting stuff. It would be great to see your tool and get some inspiration, or maybe even use it.
- nonoesp 4y agoThis sounds super interesting. I've been thinking of ways to parser phone screenshots with payment data or use bank APIs to add data to my expense tracker, as opposed to adding everything manually, which is the best way I've found for consistency and to make sure everything is properly formatted. I didn't know about PSD2. Do you have any links or references for me to look at?
- tiagod 4y agoHey, great tool! Just a little bug: I found that if I click a number to copy, then click it again, I'll get the original string in my clipboard concatenated with " Copied!"
- owl110 4y agoLooks very interesting. I think there is some ambiguity with respect to currency symbols, $ converts to USD and £ to GBP. However, depending on user location those symbols can be used to mean very different currencies.
- tonyonodi 4y agoIs there anywhere else that uses "£"? I didn't feel great about having $ default to USD but it is probably what most users want. I'll probably make it location-aware and/or allow the user to decide which it defaults to in the future.
- owl110 4y agoI believe pound sign is used in a few other places as well (see https://en.wikipedia.org/wiki/Pound_sign https://en.wikipedia.org/wiki/Pound_sign). Enforcing the use of ISO 4217 codes (https://en.wikipedia.org/wiki/ISO_4217 https://en.wikipedia.org/wiki/ISO_4217) may be a solution to avoid this type of ambiguities.
- defrost 4y agoNice - I'll give it props for: > 1 metre + 8 chain = 161.9344 m > 1 tonne + 1 short ton = 1.90718474 t > 1 tonne + 1 long ton = 2.0160469 t and give it a pass for not supporting pre 1963 UK | US historic weights and measures .. that's getting into a pretty specific use case where Standards nerds like to have a clear display of what conversion factors are in play and what provenance those factors have. Time Zone support (on your About ToDo) will be interesting, historic computations with daytime savings support will be a quagmnire :-) The SHARE DOC URLs seem a bit long - something like "base64 full text of doc as an URL" I guess. Will this hit a URL length limit if widespread use becomes a thing? jq play : https://jqplay.org/s/f1r-BZ5xYd2 https://jqplay.org/s/f1r-BZ5xYd2 regex101 : https://regex101.com/r/OqojJl/1 https://regex101.com/r/OqojJl/1 do server side storage and doc hash .. which has issues of its own.
- tonyonodi 4y agoWell, I love this comment. And yes, time zone support terrifies me an order of magnitude more than anything else on the list.
- defrost 4y agoOn the gnarly scale dealing with with pre-WGS84 paper maps from about the globe is arguably worse .. there are so many reference ellipsoids and datums used in different parts of the world at different times .. and then there are the many variations on curved surface to flat map projections to deal with. But yes - Time and date is an iceberg domain :-)
- tonyonodi 4y agoYou're right, I'm using lz-string to compress the text before shoving it in the URL. This is definitely a necessary evil for the time being so I don't need a back end component to the app. But eventually I do want prettier URLs and collaborative editing if I can make that work without it bankrupting me or driving me insane.
- simonz05 4y ago
- amelius 4y agoFor the next step, maybe you can build an editor/autocomplete with a search-engine in it (you can use an existing search engine).
- jackphilson 4y agohow expensive was that domain name lol
- tonyonodi 4y agoI'm just paying the standard fee for a .io, it's a far less polluted namespace than .com :)
- adamddev1 4y agoI like this! One thing that would be nice is a time zone converter. For example: 8:00pm 24 Aug Toronto time in Dubai time And have the conversion show up.
- tonyonodi 4y agoIt's on the list ;) https://numpad.io/about/ https://numpad.io/about/
- spiffytech 4y agoVery cool! This reminds me of the open source NoteCalc: https://bbodi.github.io/notecalc3/ https://bbodi.github.io/notecalc3/ It was discussed on HN, you might look there for inspiration: https://news.ycombinator.com/item?id=25495393 https://news.ycombinator.com/item?id=25495393
- tonyonodi 4y agoI hadn't seen that before, it's very impressive!
- bbodi 4y agoI am the author of NoteCalc, and it warms my heart that my project is mentioned here :) As a sidenote I would like to mention that NoteCalc is still in active (but slow) development, though I do it privately, and the next big release will be definitely this year.
- mad2021 4y agoJust discovered NoteCalc, really cool. Thanks!
- zwog 4y agoWhen I type `4W*3hours` the result is `12 mWh`. Same with `12Wh/3hours = 4kW`
- tonyonodi 4y agoOh, thank you for the bug report. I'm not sure why that's happening, but will look into it shortly.
- sandgiant 4y agoThis is great! Love Soulver too, but having it in the browser is fantastic. Well done!
- tonyonodi 4y agoI'm a big fan of Soulver too! It's the OG in this app category and I still use it for calculations NumPad can't do (yet!).
- bkazez 4y agoVery cool! Some ideas: 1. Doesn't seem to support area conversions (tried 400 square meters, 400 m^2, and abbreviations in between). 2. If I only give a time, it would be more useful if it gave a time-only result rather than defaulting to the current date - unless it rolls over to a different date. (E.g. in Soulver, "2:30pm + 20hr" gives "Tomorrow at 10:30".) 3. It would be nice to support multiple abbreviations for minutes (mn/min are both used in various countries).
- zweifuss 4y ago400 inch^2 -> 400 inches² 10 km^2 -> 10 km² ... works for me.
- bkazez 4y agoOhhh, I missed that "->" was the operator. I was typing "to" as in Google searches. Re dateless times, yes, I think the Soulver way is unambiguous but still human-friendly.
- tonyonodi 4y agoThanks for the feedback 1. "square" before a unit I probably will implement that in the future. I'm not sure why "400 m^2" isn't working for you, I've just tried it and it works as expected for me? 2. It's a little bit clunky, but I decided to always specify the time and date being shown because there's so much potential for ambiguity. I might revisit this if I can think of a better way of doing it that's still unambiguous (the Soulver way isn't bad tbh) 3. "min" is supported, I've never come across "mn", do you know where it's used?
- seper8 4y agoLove it! This kind of stuff should be added to notepad on Windows (in an opt-in manner)!
- imagine99 4y agoIIRC, calc.exe (Windows Calculator) has some (limited) unit conversions built in. Better than nothing in an offline environment...
- vhanda 4y agoThis is awesome. Minor bug report - * 5 feet 8 inches to centimeters -> -171.72 cm * 5 feet 8 inches to meters -> -0.7272 m * 5 feet 8 inches to cms -> doesn't work The conversion seems wrong in the case of cms, and I'm not sure why it's always negative.
- defrost 4y ago"to" is a subtraction operation, not a convert to cue. As in (distance from) 30 to 50 (is 20 == 50 - 30 )
- radiojasper 4y ago"cms" is nothing, try "cm". Also you're 100% correct that this shouldn't be a negative number. Screenie [0] [0] https://jasper.monster/sharex/firefox_eXIffwiyBq.png https://jasper.monster/sharex/firefox_eXIffwiyBq.png //EDIT Ah yeah, replace "to" with "in" and you're good! [1] [1] https://jasper.monster/sharex/firefox_rVKx2w1TUI.png https://jasper.monster/sharex/firefox_rVKx2w1TUI.png
- Spare_account 4y agoAfter reading the sibling comments to mine, I've worked out what it is doing. > * 5 feet 8 inches to centimeters -> -171.72 cm As @defrost said, the 'to' operator instructs NumPad to calculate the distance from the unit before 'to' and the unit after 'to'. To the nearest mm, 5 feet 8 inches = 172.72cm It appears that NumPad is defaulting to a value of '1' where no value is specified, so it is calcuating the distance BACK from '5 feet 8 inches' TO '1 centimeters'. It correctly responds with -171.72, which is 1cm less than 172.72. > * 5 feet 8 inches to meters -> -0.7272 m Same as above, except the calucation is the distance back from '5 feet 8 inches' TO '1 metres'.* If you use the operator 'in', NumPad calculates the answer correctly: 5 feet 8 inches in metres -> 1.7272 m
- shreyshnaccount 4y agoTHIS IS AMAZING. the next step is adding variables and assignments and conditionals, and you have something very powerful that can be used by just about anybody to do really interesting things. provided you have a way to integrate with other services that a lot of people use
- janjones 4y agoVariables and assignments are already supported.
- shreyshnaccount 4y agoshould rephrase, meant to say (variables, assignments) AND conditionals
- tonyonodi 4y agoThanks! Turning the current language into a Turing complete one would be a huge step up in complexity and I'm not sure it will ever make sense to implement. But I have thought about adding the ability for users to define their own functions in JS and might get around to that one day.
- shreyshnaccount 4y agoI see. despite my not totally unjustified hate of Javascript, Im looking forward to it.
- sjinta 4y agoThis is awesome! Some feature requests: it would be great though if you could have multiple sessions/tabs in stead of 1. Also a clear button would be nice.
- mrcartmeneses 4y agoCan’t you just select all then hit backspace? Asking for a friend...
- sjinta 4y agoWhen using it to make simple calculations while on a phone I think it would be easier than the long click select all delete combo, but perhaps this is not really the aim of the tool.
- brospars 4y agoThere is something wrong with the order of operations. When I type 2+2*2-6 i get -6 which should be 0.
- unsafecast 4y agoIt looks like APL order? Right-to-left.
- JackFr 4y agoNo. It’s not right to left. It’s just weird: 3 ^ 1 * 2 6 3 ^ 1 / 2 1.73205 3 ^ 1 + 2 5 3 ^ 1 - 2 1
- unsafecast 4y agoHuh.
- sneak 4y agoI would think this might be the first unit test one would write for a calculator program.
- deleted 4y ago[deleted]
- bdwjn 4y agoOh there's more: 9 - 3 ^ 2 = 0 9 -3 ^ 2 = 18 ??? pi = 3.1415926536 2 pi = 5.1415926536 ??? sin(3.1415926536 radians) = -0 sin(pi radians) = Incompatible units ???
- deleted 4y ago[deleted]
- OJFord 4y agoThis is great, I use `bc` a lot at work (particularly when away from desk and my actual calculator) but I'll probably bookmark this to use instead. One bit of very minor feedback: `x^y tonnes` errors 'exponent must be unitless'. The more expected (IMO) grouping `(x^y) tonnes` works, so why not have the non-error grouping be the implied one, when no parens given?
- tonyonodi 4y agoI hadn't thought about that before but I think you're right, I've added it to my roadmap. Getting operator precedence right has been pretty fraught tbh. For example "1km / 3 hours" is evaluated as "(1km) / (3 hours)", but "1 / 3 hours" is evaluated as "(1 / 3) hours", which is odd from a PL perspective, but I think it's more intuitive from a user perspective for this sort of thing.
- mixcocam 4y agoI wonder when Google docs will introduce this type of feature.
- radiojasper 4y ago... and then cancel it 2 years after?
- kretaceous 4y agoThere are a few bugs as people have mentioned but the currency support is a huge win for me. Thanks for making this!
- tonyonodi 4y agoGlad you like it! Working on the bugs today
- infinityio 4y agoon a similar note - QALC in vscode offers a similar experience for file types of your choosing
- akino_germany 4y agoTIL that it is convention in the English language to place the euro sign in front of the amount and not after it, like in most other European languages.
- skrebbel 4y agoTIL: Germans put it after the amount :-) (I'm European too and I thought it was always in front, everywhere)
- LoveMortuus 4y agoSlovenian here, we put it after. It makes more sense, at least to me, since you do say that apple costs five euros, where as the other way around: That apple costs euro five. Which would here mean that it costs 1.05€ and not 5€.
- tonyonodi 4y agoYeah, I'm British and I'll concede that how we write it doesn't make sense. I do intend to localise it/add options in the future. NumPad currently accepts numbers in the "9,999.9" format, which is the default in the anglosphere, but "9.999,9" is common elsewhere. So that's another thing I'd like to address in the future.
- ajsnigrutin 4y agoFun idea, but: 10^900=∞ :)
- tonyonodi 4y agoI think that's right, isn't it?
- bww 4y agoThis looks pretty cool. I've long been looking for something similar to Soulver (https://soulver.app/ https://soulver.app/) that I can use on Linux. This seems promising. One small criticism: In my opinion, no web-based writing app is useful unless the tab key inserts a tab. The default behavior of most browsers to move focus to the next field is tremendously infuriating in this context. Unfortunately, that's what happens here, at least for Firefox. (Related: key combinations that normally perform cursor movements but which are often used by browser for navigation.)
- dgmltn 4y agoTIL about soulver and https://github.com/soulverteam/SoulverCore https://github.com/soulverteam/SoulverCore
- gnramires 4y agoNote: I had this response typed up but didn't submit... One related app that I absolutely love is Qalculate![1] (yes, it has a built-in exclamation for default enthusiasm :) ) It can do cool stuff like converting N (newtons) to kg.m/s^2 when you specify units as ?kg. It also converts units like 1kW x 1year = 31.55... GJ It's fantastic for engineering and specially back-of-envelope calculations. This notepad aspect does seem useful though. One alternative is to use Jupyter notebooks, sometimes I work problems with Sage[2]+Jupyter. Sage is extremely powerful (you can do calculus, linear algebra, and more) but doesn't support units (that I know of), it's more geared toward advanced maths. [1] https://qalculate.github.io/ https://qalculate.github.io/ [2] https://www.sagemath.org/ https://www.sagemath.org/ It's a bit on the heavy side although it's definitely worth it if you're doing a lot of math. I think the flatpak is preferred due to its significant size.
- sigmaprimus 4y agoGood Feedback! I would think a checkbox that enables tab function would be best, how would you feel about a FF Plugin that achieves this? My only concern would be that FF has reserved that particular key and it would require special permissions to map it to your needs.
- 4y ago
- spectaclepiece 4y agoThis is an excellent tool, would be good to have some simple rounding functionality. Perhaps a generic visible decimal points settings or a round() method of some sort.
- reaktivo 4y agoOne thing that I haven't found supported in other calculators is returning the min or max between two values
- layer8 4y agoIf you have abs(), you can use the following as a fallback: min(a, b) = (a + b - abs(a − b)) / 2 max(a, b) = (a + b + abs(a − b)) / 2
- alexcosan 4y agoNice work on getting this out. I think it looks pretty neat and simple to use. I’ve had some issues when using it though: - on mobile, moving the cursor in a calculation doesn’t work very well; - More important, multiplying “200 * 10%” results in “2000%”, I believe the result should be “20”; https://www.wolframalpha.com/input?i=200+*+10%25 https://www.wolframalpha.com/input?i=200+*+10%25
- np_tedious 4y agoThose are equal values right? This is just formatting preference. I agree formatting should probably go with the first factor, but I wouldn't say current behavior is incorrect
- joshspankit 4y agoI also had issues navigating on mobile (iPad). There seem to be hover states that get in the way (example: I tapped on a line to move to that line and it had a small popup to say something was copied)
- runxel 4y agoReally cool! Only missing a "sum" function.
- tonyonodi 4y agoThanks! I'll be implementing a sum (and mean/median/mode) function soon.
- swah 4y agoCongrats! I'd say it makes no sense to post here before doing hex,bin,dec conversion and bitwise operations ;)
- samwillis 4y agoI like how you are using a Gist for the exchange rates (https://gist.github.com/tonyonodi/e154f529180b1f0f475966d333f5dec4/ https://gist.github.com/tonyonodi/e154f529180b1f0f475966d333...), do you have a GitHub action setup to automatically update that?
- tonyonodi 4y agoImpressed you found that. I don't have anything set up to automatically update it currently, but I do have an intention to have something set up to automatically update it.
- samwillis 4y agoHa, yes, I was being nosy. It was quite easy to spot as it's the only XHR/Fetch request. I was intrigued what you had used to build it, and if you had built your own solver (which you have), and what editor you used (Code Mirror) so went looking at the code. Interesting to see you left the source maps for production, made it easy for my sleuthing... I experimented with a similar idea last year, but used ProseMirror/TipTap as the editor to enable rich text editing, and the MathJS (https://mathjs.org https://mathjs.org) solver. I also combined it with PouchDB and Yjs for offline editing and syncing between devices. Never finished it though, you have kept your nice and simple!
- tonyonodi 4y agoOops, didn't realise I'd left source maps in, thanks for pointing it out! Your project sounds really interesting, I'm following you on twitter now, so tweet about it if you ever finish it and hopefully I'll see. Having CRDT-based syncing/collaboration is a direction I'd like to take NumPad in eventually, and if I have time. But I definitely think that ignoring that part completely has allowed me to get it to an MVP state.
- ewidar 4y agoBtw the conversions don't seem to work for me: > 100 eur to usd $-100.63 > 100 usd to eur Incompatible units
- tonfreed 4y agoVery cool idea, would love to see it work with recipes if you could manage it. I always have to look it up when I see a cup of butter listed in the ingredients of a cake
- jjt-yn_t 4y ago
- doerig 4y agoVery nice! Reminds me a lot of numi (https://numi.app https://numi.app). Similar, but MacOS only (and paid).
- athenot 4y agoBig fan of numi, somehow I like it better as a smaller window tucked on the corner of my screen than a full browser page.
- staz 4y agoI find it pretty cool. Some feedback: I tried to convert m/s in km/h and it wouldn't works, finally found how to do it, you need to specify `hour` in full letters I assumed it was something like an etherpad that you could edit collaboratively but apparently not
- tonyonodi 4y ago"kph" is also supported, will add support for "km/h"
- joshspankit 4y agoAnd `mpg`/`l/100k` please!
- tonyonodi 4y agoI've avoided adding mpg because the UK and US disagree on what a gallon is and mpUKg/mpUSg is not very nice to look at. You can write "miles per gallon" or "miles per US gallon" because per is the same as the "/" operator, and you can sort of do "L/100km" but you can't convert to it. I'll have to think some more about this one.
- joshspankit 4y agoI think I see where you’re going. I’d be comfortable with “litres per hundred kilometres” if that’s possible and especially if there was a “did you mean” suggestion prompt
- tonyonodi 4y agoThis is fixed now https://numpad.io?#text/JwOgHAtg9AzgBASwHZwNbQBZA https://numpad.io?#text/JwOgHAtg9AzgBASwHZwNbQBZA
- JacobSeated 4y agoI would love to have a plain text "notepad" for iOS, because the built in app is horrendous and converts links to clickable hyperlinks. Etc. Hate that piss shit.
- dskloet 4y agoOn my Android phone I can't see the last letter of some lines and I'm unable to zoom out.
- huhtenberg 4y agoMath is not terribly precise I'm afraid :) > 1111111111111111111111111111111*9 > 10,000,000,000,000,000,000,000,000,000,000
- joshspankit 4y agoThat doesn’t seem like a floating point inaccuracy. What’s going on there?
- tonyonodi 4y agoNumPad uses Decimal.js to represent numbers https://mikemcl.github.io/decimal.js/ https://mikemcl.github.io/decimal.js/
- benecollyridam 4y ago1=2 1+1 // = 4 Really nice project though https://numpad.io?#text/IwXgTAUMDUxA https://numpad.io?#text/IwXgTAUMDUxA
- deleted 4y ago[deleted]
- tonyonodi 4y agoSome people just want to watch the world burn. No, you're right. I thought I'd prevented it from parsing numbers as variables, but apparently not. It's on my todo list now.
- tonyonodi 4y agoFixed, thanks for pointing it out :) https://numpad.io?#text/IwXgTAUMDUwARA https://numpad.io?#text/IwXgTAUMDUwARA
- Lanrei 4y agoInline whitespace summation at the same time as mathematical operations seems like a problem. I don't think that there's a standard order of operation for that sort of thing.
- 0xRusty 4y agoIt's very nicely done, but I'm afraid I don't "get it" with things like this and written out calculators in general. Why would I type out something long like: " Alice's food = £30 Bob's food = £25 VAT = 20% Alice's food + Bob's food + VAT " Rather than just punch (30+25)*1.2 straight into a calculator?
- wccrawford 4y agoMaybe you want to store all that information for later and also want the calculation, both now and later?
- 0xRusty 4y agoSo...a spreadsheet?
- samwhiteUK 4y agoA spreadsheet won't automatically work out and display units for you
- samatman 4y agoI've found that the Calca[†] format hits a nice sweet spot between using an ordinary calculator and running a spreadsheet. [†]: http://calca.io http://calca.io It's particularly suited to calculations I'm doing by fetching various numbers from websites, and for the most part it 'composes' by just copypasting a calca into another one. Basically where the numbers mean something, aren't stable / I don't know them all when I start, but there's no tabular data or significant aggregation going into the question.
- BWStearns 4y agoI can see this being useful as a narrative document for collaboration. Explaining to someone how a business process might work given x/y/z pricing. Easy to embed the "why" aspects of things but also it autocalcs things so they could play with the numbers and see the change in impact. Some people can "think in spreadsheet" (I'm quite happy there) but that's not the best medium for everyone.
- xixixao 4y agoI also made one of these, still working on it now with a focus on including support for accuracy/measurement errors. This is impressively close to what I have in my desired spec (but already more future proof). Congratz! https://github.com/xixixao/recomputer https://github.com/xixixao/recomputer https://xixixao.github.io/recomputer/ https://xixixao.github.io/recomputer/
- tonyonodi 4y agoNice work! I like that you're using rational numbers, I thought about going that route but decided to compromise by using Decmial.js in the end. Also really like the "Same Use Case" section in your readme. It's a good summary of the reasons I made this app :)
- badcppdev 4y agoMini feedback: The difference between a defined variable and an undefined variable could be clearer. And should an expression with an undefined variable still give a value? So if you had: Alice's food + Bob's foood = £30 then I think there should be more to highlight the typo. P.S. This is an awesome thing
- badcppdev 4y agoOoh a super useful function (in my experience) is the monthly mortgage repayment calculator. MonthlyRepayment(principle, annual_interest, term_in_years)
- T3RMINATED 4y ago
- supernes 4y ago"Right hand side of subtraction cannot be a date or time." :(
- Severian 4y agoCan you add bit and byte values, as well as units per unit of time please? Base 10 (GB for example) and base 2 (GiB) would be very handy. Full words as an alias as well, so GB -> gigabyte, and GiB -> gibibyte. That way you can do something like: 1GB / 40MB/s in minutes 1GB to Gib 1GB to bits 50 bits to bytes
- tonyonodi 4y agoYes I can, I'm busy with launch stuff today but I'll get that done soon
- shash 4y agoInteresting! Thank you... I was trying to divide an area by a smaller area to get the number of widgets, and it insists on making that into a percentage. Is there a way to make it report a raw number instead of percentages when the two quantities are the same unit?
- tonyonodi 4y agoWhat's the exact calculation you're doing?
- layer8 4y agoThis is really neat, but you need to rethink the date/time/duration arithmetics. You’re equating 12 months with 365.25 days, which gives rise to results like “1 month - 31 days” giving “-0.0184804928 months”. At the same time, “30th January + 1 month” gives “28 Feb 2022 at 12:00:00” (why “2022”, and why “at 12:00:00”? — this is only a date calculation without reference to a year or to a time of day), while “30th January + 30 days” gives “1 Mar 2022 at 12:00:00”, although “1 month in days” gives “30.4375 days”. In reality, months/years are simply not convertible to days/weeks arithmetically, and you can’t sensibly add months to certain dates, and sometimes also not years (for February 29th). The former should give “Incompatible units”, and the latter should result in something like “Undefined” for incompatible dates.
- ascar 4y agoMinor bug report: for whatever reason entering a space on my Android keyboard enters the next suggestion on your editor. That's a feature I explicitly disabled, but is active on your website. On top of that if that enters an unrenderable character I see a red dot that's undeletable.
- MrGilbert 4y agoReally cool. Minor user pain: When starting a new line, and the first character is 'e', it gets evaluated to the euler constant. Would be cool if you could find a way to prevent that. :)
- pwdisswordfish0 4y agoThe docs say that this is using CodeMirror. The CodeMirror license says that you're allowed to use CodeMirror for your stuff, but that stuff has to in turn include: 1. the copyright notice 2. the text itself that explains that you/others have this permission/obligation Currently, it looks like NumPad isn't doing either. From comments here, NumPad is evidently also using decimal.js, which has similar terms.
- tonyonodi 4y agoBoth are MIT licensed, I don't think this is the case.
- samatman 4y agoIt's true of source code but not artifacts. MIT places no obligation to distribute source, but requires credit and license when someone does so.
- tonyonodi 4y agoThanks for clearing that up, I'm not distributing the source code so I think I'm good.
- pwdisswordfish0 4y agoDon't look to people who don't know what they're talking about to "clear things up" for you. If you think they have any qualms about leaving you to deal with the blowback after misleading you with uninformed takes (and pointing the finger at you for putting your faith in them to begin with), then you're setting yourself up to be burned. There's a reason why everyone who has their ducks in a row (in other words, people with competent legal counsel along with something to lose, e.g. Mozilla, Google, Apple, Microsoft, etc) will bake something like about:license into the stuff they work on, even if it's buried in some "open source licenses" entry of an About screen reachable by the last menu item in the system settings. Spoiler alert: it's because they have to—in order to comply with the terms of the license. It's not because they just think it's the nice thing to do. (And definitely not because it's fun and easy to do, because it's not.)
- dailyplanet 4y agoThe feet to meters conversion, or vice versa, doesn't work.
- lazylion2 4y ago"Share Doc" doesn't work if you edit a shared doc
- ohadpr 4y agoFantastic, thank you for implementing one of my future side projects. I was planning to build a web-based version of Soulver with sharing/collaboration. I hope this can fill that spot for me.
- llimllib 4y agoIt would be cool if "6 minutes / 1 mile in min/km" showed `3:44` instead of (in addition to?) `3.7268` I wrote my own little calculator, much less general than this, to answer running time questions like "to run an 18 minute 5k, what would my mile pace be"? and it would be neat if that were cleanly solvable in a tool like this
- tonyonodi 4y agoYeah, that's a feature I really wanted to get out before my launch deadline but sadly it didn't make the cut. Soon though.
- mkrishnan 4y agoLove it. Thank you! Thank you! Thank you!.
- jbaczuk 4y agoNice! What is the long term goal with numpad?
- anthropodie 4y agoCan I self host this?
- jdoss 4y agoI second this question. I would love to selfhost this too. I hope the creator considers opensourcing their work.
- carapace 4y agoSee also Frink: https://frinklang.org/ https://frinklang.org/ > Frink is a practical calculating tool and programming language designed to make physical calculations simple, to help ensure that answers come out right, and to make a tool that's really useful in the real world. It tracks units of measure (feet, meters, kilograms, watts, etc.) through all calculations, allowing you to mix units of measure transparently, and helps you easily verify that your answers make sense. It also contains a large data file of physical quantities...
- seligman99 4y agoAlong the same lines, I made a command line calculator that does basic unit conversions, and has a few other tricks up it's sleeve https://github.com/seligman/human_calc https://github.com/seligman/human_calc I find it surprisingly useful. It's probably one of those things that has an audience of one, but I find it useful.
- tonyonodi 4y agoThis is really cool, you're a braver person than I for tackling the English representation of numbers stuff!
- AbraKdabra 4y agoI tried converting USD to ARS and it didn't work, I guess you should make a list of how units are named so I can use the correct one.
- flanbiscuit 4y agoLooks good! I love the idea of the embedded calculator I noticed that it doesn't handle remainder/modulo (%) equations: "10 % 2" results in: "Left hand side of addition cannot be a percentage." It does look like decimal.js can handle that: https://mikemcl.github.io/decimal.js/#mod https://mikemcl.github.io/decimal.js/#mod https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- ianbicking 4y agoYou can do "6% of $10" and get "$0.6" (minor note that it would look better as $0.60). Looks like there's a mod operator, so "2303 mod 10" gives 3.
- mcintyre1994 4y agoIt does, but you have to type `10 mod 2`
- xaduha 4y agoI'm surprised no one mentioned https://insect.sh https://insect.sh yet.
- xerxesaa 4y agoSuper cool. I wish this was open source so I could see how you did some things, but I understand you've decided to keep it closed. Just to satisfy my curiosity, would you mind sharing how you did parsing at a high level? Did you use some publicly available parser/lexer or did you just implement pattern matching yourself with something like regex or other token splitting measures?
- ralphb 4y agoI've found that a super simple way to parse basic expressions is a recursive descent parser. It is very simple to implement. No need to to break into tokenizer/parser, no need to generate an AST, just evaluate the expression while parsing.
- lsferreira42 4y agoDo you have an example of a simple parser like that?
- ralphb 4y agohttps://gist.github.com/revivalizer/935dfcc345b009a0207a033caee0175f https://gist.github.com/revivalizer/935dfcc345b009a0207a033c... Even includes error handling :) At the bottom you can see some test examples of what it can do. Obviously it is a basic calculator.
- tonyonodi 4y agoI'm very glad you asked. I wrote my own parser combinator library in TypeScript partly based on eulalie[0], so it doesn't have a separate lexer and parser and doesn't rely heavily on regexes (though it does use them to do things like match a single alphanumeric character). I plan on open sourcing this library one day once I can tidy up the API because I think it would be useful to other people. 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: append( string("as"), oneOrMore(space), optional(append(string("a"), oneOrMore(space))), percentSymbol, oneOrMore(space), string("of") ) [0] https://github.com/bodil/eulalie https://github.com/bodil/eulalie
- amitheonlyone 4y agoThis is really cool. I usually end up doing some weird math during development and I usually use the browser developer tools which is a bit cumbersome. This might help me replace it.
- harpiaharpyja 4y agoVery cool! Any plans to support vector/matrix operations? I occasionally do some work with 2D/3D graphics or physics and having some basic linalg would be nice. I can see myself using this a lot as a scratch pad to hash out ideas while implementing stuff. The ability to define custom functions would be very helpful for that.
- tonyonodi 4y agoIt's something I've thought about but I'm not sure I'm going to implement it for a while as it would be quite a big undertaking. The same is true of complex numbers unfortunately.
- botinko 4y ago2+2*2-3 calculated as 0. WAT?
- botinko 4y ago2+2 -> 4 ok 2+22 -> 6 ok 2+22-3 -> 0 What?
- suntuba 4y agoYes - there is a precedence problem. Try 2*2-3 (2 times 2 minus 3).
- ghjm 4y agoMaybe there's already a way to do this, but it seems to me that it would be useful to be able to refer to the answer on a previous line, like the Ans key on a TI calculator. So: 2 + 3 (=4) Ans * 2 (=8)
- softawre 4y agox = 2 + 3 x * 2
- stephc_int13 4y agoI really like it, except the fact that it is not an app but something on the web. I wish it could be something lightweight and launched as a native app.
- suntuba 4y agoNice app - I like the workspace sharing feature. It would be nice if "1 mm / inch" would be returned as a unitless number. I know that you can enter "1 mm in inch" but there are cases where it would help to have the calculator reduce the units for you.
- tesseract 4y agoFor what it's worth, `1 mm/inch in 1` seems to work as expected.
- majkinetor 4y agoThere is a bug with unintendend addition if word starts with the variable name e2foo 4.7182818285 pi-hole 3.1415926536
- majkinetor 4y agoOn srelated note, I use Markdown Excel: * https://github.com/cescript/MarkdownFormula https://github.com/cescript/MarkdownFormula Its totally awesome, although it needs some more work.
- hidelooktropic 4y agoThis is a great demonstration of a feature I feel is greatly missing from modern note taking applications like Notion.
- barroomhero 4y agoThis is fantastic. I never realized how much I wanted this. Thank you for opening my eyes. Now we need to port to Obsidian.md! haha.
- euos 4y agoLooks so cool and clean. Stealing the design for my project
- dubcanada 4y agoSmall bug report 23 USD to CAD = -28.875332087 CAD $23 USD to CAD = -30.174259569 CAD It does not appear to like the USD/CAD stuff
- felipelalli 4y agoIt would be nice to be an emacs extension. :)
- mjaniczek 4y agoVery nice! Bookmarked. I found a small bug: `5 hours 20 minutes` will give you `5 hr 19 min 60 s`. This only happens with some numbers in the minutes slot.
- unnouinceput 4y agoOne thing it's missing which is trivial to implement. Have a little checkbox adjacent to line numbers, default true, that when unchecked would simply not parse the calculations, just leave it as simple text. This way writing "and here is a little example of 9^9^9" and simply copy paste that to next line would allow me to not have it evaluate on text, but only on next line. OF course, a little more complicated to implement would be next step of actually select the text and within the pop-up have "Don't evaluate". This way writing a documentation without having always calculation be in your way would be very easy. Other than that, this looks great ma' dude. Keep it up!
- GauntletWizard 4y agoI would really appreciate if there were units for si prefixes, common orders of magnitude, and compute, i.e. "G", "M", "billion" "million", "megabytes" and "gigabytes"
- FpUser 4y agoThis is actually very useful app and done very nicely. Congratulations.
- skeoh 4y agoSuper cool and congrats on shipping! Something I'd love to see is the ability to embed a document on other sites via iframes a la GitHub Gist embeds. That way I could, say, write a blog post describing an algorithm, embed an example of the calculations, and allow visitors to tweak the values and see how they affect the output. Well done!
- t0rchlight 4y agoThanks! I've been looking for numi alternative for my Windows desktop.
- joeframbach 4y agoI'm trying to figure out how many "miles per hour" I get while charging my vehicle. I have a 3.3KW charger and I average 3.1 miles per KWh while driving. I expect that I am charging at a rate of 10.23 miles per hour. So 3.3 KW * 3.1 miles per KWh Says "3.3". The math is wrong and the units are gone. Actually, it doesn't seem to understand the concept of a KW. I'll try "kilowatt" and "kilowatt-hour" respectively. 3.3 kilowatt * 3.1 miles per kilowatt-hour Says "Incompatible units". The closest I got was 3.3 kilowatt * 3.1 miles per kiloWh Says "10.23 kW mi". insect.sh is able to do that last one. 3.3 kilowatt * 3.1 miles per kiloWh 3.3 kW × (3.1 mi / kW·h) = 10.23 mi/h
- xaos 4y agoThe "kilo" prefix is a lowercase k. If you fix that, it works perfectly: "3.3 kW * 3.1 miles per kWh" Gives "10.23 kW mi / kWh" as you expected I guess ideally you would want it to factor out the kW.
- wisdomseeker_ 4y agoLooks good!
- XCSme 4y agoThat's really cool! Anyone knows if there's a way to have this feature in Joplin[0] ? [0]: https://joplinapp.org/ https://joplinapp.org/
- SimonWaldherr 4y agoFunny, almost at the same time I published a similar tool on github. https://github.com/SimonWaldherr/liveCalc https://github.com/SimonWaldherr/liveCalc Mine is released under the MIT license and is mostly based on math.js. Suggestions for improvement and pull requests are very welcome.
- dgmltn 4y agoThis is awesome! I'd love to use it on the command line, or as a json API!
- terminal_d 4y agohttps://github.com/printfn/fend https://github.com/printfn/fend Similar tool for people who prefer to use the terminal. Emacs' calc is also pretty much the same thing.