Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



"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

//EDIT

Ah yeah, replace "to" with "in" and you're good! [1]

[1] https://jasper.monster/sharex/firefox_rVKx2w1TUI.png


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


"to" is a subtraction operation, not a convert to cue.

As in (distance from) 30 to 50 (is 20 == 50 - 30 )




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: