PDA

View Full Version : Are there any apps to convert units?



figure9
February 20th, 2008, 01:55 AM
Is there a units conversion application for ubuntu? Basically a program that will convert a clumsy unit like kilometers per hour a useful unit like furlongs per fortnight?

Fbot1
February 20th, 2008, 01:59 AM
http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=bJd&q=1+foot+in+microns&btnG=Search

bruce89
February 20th, 2008, 02:07 AM
http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=bJd&q=1+foot+in+microns&btnG=Search

In other words, search google for things like "1 foot in centimetres" etc.

Furlongs per fortnight sounds very clumsy.

~LoKe
February 20th, 2008, 02:10 AM
http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=bJd&q=1+foot+in+microns&btnG=Search

Google is not an application.

Fbot1
February 20th, 2008, 02:14 AM
Google is not an application.

but web browsers are

bruce89
February 20th, 2008, 02:19 AM
Google is not an application.

Fine, try this:



#include <stdio.h>

enum
{
INCH_TO_CM = 1,
POUND_TO_KG = 2,
FOOT_TO_M = 3
} mode;

int
main (void)
{
int mode;
double imperial;
double metric;

printf ("Choose from the menu\n");
printf ("1 -- Inches to centimetres converter\n");
printf ("2 -- Pounds to kilograms converter\n");
printf ("3 -- Feet to metres converter\n");
scanf ("%d", &mode);

switch (mode)
{
case INCH_TO_CM:
/* Program 1 */
printf ("Enter inch value ");
scanf ("%lf", &imperial);
metric = imperial * 2.54;
printf ("%lf\n", metric);
break;
case POUND_TO_KG:
/* Program 2 */
printf ("Enter pounds value ");
scanf ("%lf", &imperial);
metric = imperial * 0.4535924;
printf ("%lf\n", metric);
break;
case FOOT_TO_M:
/* Program 2 */
printf ("Enter feet value ");
scanf ("%lf", &imperial);
metric = imperial * 0.3048;
printf ("%lf\n", metric);
break;
default:
fprintf (stderr, "Mode not recognised\n");
}
return 0;
}



gcc -g -Wall -o conv conv.c

JonUK76
February 20th, 2008, 02:27 AM
Yes, add the ConvertAll program through Add/Remove programs. Works for me :)

Fbot1
February 20th, 2008, 02:40 AM
Fine, try this:



#include <stdio.h>

enum
{
INCH_TO_CM = 1,
POUND_TO_KG = 2,
FOOT_TO_M = 3
} mode;

int
main (void)
{
int mode;
double imperial;
double metric;

printf ("Choose from the menu\n");
printf ("1 -- Inches to centimetres converter\n");
printf ("2 -- Pounds to kilograms converter\n");
printf ("3 -- Feet to metres converter\n");
scanf ("%d", &mode);

switch (mode)
{
case INCH_TO_CM:
/* Program 1 */
printf ("Enter inch value ");
scanf ("%lf", &imperial);
metric = imperial * 2.54;
printf ("%lf\n", metric);
break;
case POUND_TO_KG:
/* Program 2 */
printf ("Enter pounds value ");
scanf ("%lf", &imperial);
metric = imperial * 0.4535924;
printf ("%lf\n", metric);
break;
case FOOT_TO_M:
/* Program 2 */
printf ("Enter feet value ");
scanf ("%lf", &imperial);
metric = imperial * 0.3048;
printf ("%lf\n", metric);
break;
default:
fprintf (stderr, "Mode not recognised\n");
}
return 0;
}


gcc -g -Wall -o conv conv.c

Lol, wouldn't it be a whole lot easier to just use multiplication and division.

mikelygee
February 20th, 2008, 03:13 AM
As a command-line sort of guy, I use "units":


$ units
1989 units, 71 prefixes, 32 nonlinear units

You have: kilometres per hour
You want: furlongs per fortnight
* 1670.2424
/ 0.00059871548
You have:
^D

or simply:

$ units "kilometres per hour" "furlongs per fortnight"
* 1670.2424
/ 0.00059871548

quanumphaze
February 20th, 2008, 04:49 AM
Try "Qalculate!"
It's an advanced calculator with a conversion feature.

Find it in Add/Remove

Vadi
February 20th, 2008, 04:51 AM
Qualculate does everything.

sobakasu
April 3rd, 2008, 09:36 AM
Or try convertall. It's in the repos but I haven't yet tried it personally.
It's a QT app, though -- does anybody know if there's a GTK alternative? Under Windows, I loved Abby (http://www.sheepfriends.com/?page=abby). I don't know, there might be something as simple for Linux without the need for using WINE?

swordsearcher
April 7th, 2008, 12:36 AM
Here is one....


Quad-Lock Unit Converter (http://www.swordwarrior.net/UnitConverter.html)

HermanAB
April 7th, 2008, 01:17 AM
The program 'units' is pretty good:

$ units
2439 units, 71 prefixes, 33 nonlinear units

You have: 12 liters per hundred kilometers
You want: miles per hogshead
reciprocal conversion
* 1234.8766
/ 0.00080979754

You have: 160 kilometers per hour
You want: furlong per fortnight
* 267239.32
/ 3.7419643e-06

The * is the answer you want, the / is the reciprocal, which is sometimes useful.

Cheers,

Herman

adamklempner
April 7th, 2008, 03:32 AM
I know it is not a stand alone app, but:

http://www.onlineconversion.com/

does pretty much everything I have ever thrown at it. And I am an engineer who has worked with some very odd units...

Iandefor
April 7th, 2008, 04:36 AM
I'll have to give another shoutout to units. It handled kilometers per hour to furlongs per fortnight without a hitch:


ian@leviathan:~$ units "1 kilometer per hour" "furlongs per fortnight"
* 1670.2458
/ 0.00059871429It's also good enough to tell me the speed of light in a vacuum in stadia per month in the Islamic calendar:

ian@leviathan:~$ units -t "299792458 meters per second" "stadia per islamicmonth"
4.1303298e+12

shrinux
November 18th, 2008, 08:11 PM
Yes, add the ConvertAll program through Add/Remove programs. Works for me :)
Thanks man :-)

bobbocanfly
November 18th, 2008, 08:15 PM
Google uses GNU "units" (the command everyone is telling you about). I watched a talk where someone (Benjamin Mako Hill?) typed in a phrase that bugged out in GNU Units, and got the exact same output from Google.

mips
November 18th, 2008, 09:39 PM
Basically a program that will convert a clumsy unit like kilometers per hour a useful unit like furlongs per fortnight?

Why, did you invent a time machine?

forrestcupp
November 18th, 2008, 11:16 PM
Google is not an application.

Google absolutely is an application. Google actually encompasses several applications. Their apps just happen to use a web browser as their vehicle. There's a reason they call one set of their applications "Google Apps".

If you've ever programmed a web app using PHP or any one of many other web languages, you probably wouldn't appreciate it if someone said it's not an application. ;)

But I'm willing to concede that a web page created with simple html is not and app.

daverich
November 18th, 2008, 11:16 PM
I like using google ,- it'll do currency conversion too.

Kind regards

Dave Rich

Mr. Picklesworth
November 19th, 2008, 01:10 AM
Gourmet does unit conversions if you ever need to do food stuff. It even handles densities in some cases. Really handy with butter, for example.
Otherwise, Qalculate is indeed the way to go,

Paqman
August 10th, 2009, 04:31 PM
There's a great app called "elementary arithmetic" that can do this for you ;)

Osmodivs
October 5th, 2011, 04:52 AM
http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=bJd&q=1+foot+in+microns&btnG=Search

He asked for "applications in UBUNTU".
:x

sffvba[e0rt
October 5th, 2011, 05:05 AM
Back to sleep thread...


404