Live data from Hacker News

Show HN: I made a web-based notepad with a built in unit calculator

numpad.io

61–70 of 246 posts

Re: Show HN: I made a web-based notepad with a built in unit calculator

#61
post #48

This 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?

I 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.

Re: Show HN: I made a web-based notepad with a built in unit calculator

#62

TIL 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.

TIL: Germans put it after the amount :-) (I'm European too and I thought it was always in front, everywhere)

Slovenian 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€.

Re: Show HN: I made a web-based notepad with a built in unit calculator

#63
post #45

Earlier quoted context omitted.

Oh 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 ???

Seems to assume + if an arithmetic operator is missing?

This is correct, the idea is that you can type things like "6 foot 3 inches" and have it evaluate as an addition. But the example shown above is definitely a problem, I'll try to think of a work around.

Re: Show HN: I made a web-based notepad with a built in unit calculator

#64
post #32

This 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.

After 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

Re: Show HN: I made a web-based notepad with a built in unit calculator

#65
Nice 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

Re: Show HN: I made a web-based notepad with a built in unit calculator

#67
post #57

This looks pretty cool. I've long been looking for something similar to Soulver ( 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 leas…

Good 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.

Re: Show HN: I made a web-based notepad with a built in unit calculator

#68
post #20

Looks 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.

Is 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.
Post reply on HN