This forum has been archived. All content is frozen. Please use KDE Discuss instead.

From Metric to Imperial

54

Votes
55
1
Tags: krunner krunner krunner
(comma "," separated)
User avatar
Madman
Registered Member
Posts
593
Karma
1
OS

[KRunner] From Metric to Imperial

Fri May 01, 2009 11:15 am
Currently, when in KRunner, typing, "175 cm in feet" shows 175 cm in feet. However, it shows the decimal place of the foot instead of the equivalent in inches.

Me being a stupid brit, it would be nice to be able to type, "175 cm in feet and inches" in order to get the full imperial measurement.


Madman, proud to be a member of KDE forums since 2008-Oct.
User avatar
Angel Blue01
Registered Member
Posts
220
Karma
0
OS
Agreed, this would be useful, I often need to convert from feet and inches to SI :)


Proudly dual-booting openSUSE 11.1 with KDE 4.3 and Windows Vista on a Toshiba A205-S4577 since July 2007.
boris_stitnicky
Registered Member
Posts
7
Karma
0
I didn't know about this feature at all! That makes me a good tester for the least surprise principle, which should be observed. I tried several combinations with following results:
  • "5 feet in cm" - works (wow)
  • "5 mm in yards" - as expected
  • "175 cm in feet" = 5.7414... feet, which, on the second thought, is actually the best answer - you are asking to convert specifically to feet, so you get it in feet with decimal places. To get your result with feet, inches and whatnot, you imho should be able ask:
  • "175 cm in imp" or "175 cm in imperial" or "175 cm in imperial units", neither of which works (of course, I don't really expect krunner to be smart)
  • "5' in cm" - doesn't work, and should
  • "5' 3'' in cm" - doesn't work, and should
  • "5 feet 3 inches in cm", "5 feet and 3 inches in cm" - doesn't work and should
  • "5 + 3" doesn't work, but on the second attempt "5 + 3 =" I get what I want
  • trying to work around 5' 3'', I try "5 feet + 3 inches =", "5 feet + 3 inches = in cm", "5 feet + 3 inches = [cm]", "5 feet in cm + 3 inches in cm =", "(5 feet in cm) + (3 inches in cm) =", after which I give up
  • Then my attention veers to the fact that 5' can also mean five angular seconds, I try "5' in degrees", "5' in radians", "5 seconds in degrees", "5 seconds in radians", "5 angular seconds in radians", all negative.
  • Those degrees bring my attention further to temperature, so noticing first that "5 feet" gives the result in meters, I try in vain "5 degrees celsius", "5 degrees Celsius", after which I'd like to type "5°C", but difficulty of typing ° makes me type "5C" first, with positive result. (finally)
  • "5 C in F" also works, but not "5C in fahreheits", "5C in fahrenheits"
  • At this point, I was expecting I'd soon get bored with the exercise and stop, but Krunner beat me to it - it got tired and refused to answer any further requests, not even those that it answered before. (After 30s, it was O.K. again, but I lost interest, I just tried the last one "30s", "30 seconds", "30 seconds in hours", none of which worked)
User avatar
TheBlackCat
Registered Member
Posts
2945
Karma
8
OS
I think this can be generalized into being able to split units into groups.

So for instance 5 a in b c should do the following:

1. Figure out which is unit is larger, b or c
2. Convert 5 a to b
3. Convert everything after the decimal of b to c
4. Display the everything before the decimal as b, everything after as c.

So for example if you typed ".005555 km in m cm" it would display "5 m 55.5 cm". ".005 km in m cm" would display "5 m 0 cm". That way the runner wouldn't have to worry about anything specific about the imperial unit system, it would be a general approach for breaking up units.

This isn't very useful for metric units as I used in this example, but for imperial units and angle units it would be very useful.

You could also string this together further, so for instance "5.55555555 km in km m cm mm" would display "5 km 555 m 55 cm 5.55 mm".

Last edited by TheBlackCat on Thu May 07, 2009 4:31 pm, edited 1 time in total.


Man is the lowest-cost, 150-pound, nonlinear, all-purpose computer system which can be mass-produced by unskilled labor.
-NASA in 1965
User avatar
Madman
Registered Member
Posts
593
Karma
1
OS

[KRunner] From Metric to Imperial

Sun Sep 06, 2009 1:46 pm
Question: how easy would this be to implement?


Madman, proud to be a member of KDE forums since 2008-Oct.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]