Questions tagged [unit-conversion]

Unit conversion is the process of applying an arithmetic transformation (usually multiplying/dividing or adding/subtracting) using a conversion factor to convert one textual representation of a quantity, based on one unit, to another.

Unit conversion is the process of applying an arithmetic transformation (usually multiplying/dividing or adding/subtracting) using a conversion factor to convert one textual representation of a quantity, based on one unit, to another.

Dimensional analysis is a related process that can assist in identifying the conversion(s) to be performed.

91 questions
1
vote
2 answers

Convert Decimal Degrees or Degree Minutes Seconds to Meters in Java

I am working with a GIS project. Right now I have code to convert decimal degrees to degree/minute/seconds, but I don't have any idea how to convert decimal degree or degree/minutes/seconds to meters. Can anyone help me to convert decimal degree…
nagarjuna
  • 11
  • 1
  • 2
1
vote
0 answers

Django: how to best implement unit conversion a la Markdown?

Currently building a site on energy efficiency. I have a team of scientists readying articles for our custom Django CMS with lots of numbers and attached units located in their contributions. I would like to offer visitors a way to switch between…
Auberon
  • 35
  • 4
1
vote
0 answers

how to convert decimal degree to metric unit in simulating the moving of an object in c#

i have a simulating of moving object in c#. i have some coordinates and speed(moving force) vector value in every coordinate. all of the coordination are decimal degree like below: lon:57.513958 lat:30.369513 in each point there is two force value…
1
vote
1 answer

Is JScience money unit conversion inverted?

I just came across this odd behaviour of JScience (4.3.1) when converting EUR to USD with the fictive conversion rate 1.05 (meaning I get 1.05 USD if I pay 1 EUR): Currency unitMoney1 = Currency.EUR; Currency unitMoney2 =…
Kalle Richter
  • 8,008
  • 26
  • 77
  • 177
1
vote
2 answers

Converting constantly updated units in textboxes on command

I have three textblocks whose text are bound to three different properties.
pfinferno
  • 1,779
  • 3
  • 34
  • 62
1
vote
1 answer

Data change happens in unit conversion

I am working on a calculation project which uses a lot of formulas. These formulas were defined for metrics Unit of measure(UOM) contains lot of constants. So if you give any data in Metric UOM (like kg,mm,km/h), it will give result. But as an…
kbvishnu
  • 14,760
  • 19
  • 71
  • 101
1
vote
0 answers

How to bind the logics for conversion?

I am building an UnitConverter App in android. Creating spinners adapters binding them everything is done. Now the main part remains that is putting the logics. How do i add them? Like If from the "From" spinner Second And from "To" spinner…
Hasib Hasan
  • 93
  • 1
  • 2
  • 10
1
vote
1 answer

Unit Converter...keeps returning 0

I'm trying to convert between units. Whenever I run the tester and enter an input, the output is always 0. For example, if I ask to convert from inches to feet, and I enter 12 inches, the output is 0.0 ft. Here's my class (sorry that it's extremely…
1
vote
5 answers

x raised to the power 0 does not evaluate to 1

I created a class for doing unit conversions, specifically bytes to kilobytes, megabytes, gigabytes, etc. I have an enum with B through PB, but for some reason 1024^0 does not return 1 and it's not correctly converting from bytes to bytes or bytes…
Cameron Tinker
  • 9,634
  • 10
  • 46
  • 85
1
vote
3 answers

need program logic for unit converter

This is for my android app Unit Converter. I have three spinners: unit, from and to. Eg. Angle, Degree & Radian. I have added a listener for the unit spinner. Upon selecting a unit, the from and to spinners will be filled. The user will enter input…
Frozen Crayon
  • 5,172
  • 8
  • 36
  • 71
1
vote
2 answers

Automatic unit conversion?

is there a package available that does automatic unit conversion? Something that searches for the optimal unit for displaying purposes. For example when I have the number 0.000001m it outputs 1 µm? Or 0.000000001m to 1 nm
madmax
  • 1,803
  • 3
  • 25
  • 50
1
vote
4 answers

Objective-c mile/km conversion

In my iPhone application, the user can change the unit (km or mile) in the preferences. [[NSUserDefaults standardUserDefaults] setObject:@"km" forKey:@"distanceUnit"]; or [[NSUserDefaults standardUserDefaults] setObject:@"mile"…
tchike
  • 154
  • 4
  • 21
0
votes
4 answers

What's wrong with my temperature conversions?

In this program Iam trying to take 78 degrees Fahrenheit and return them in a class with the Celsius version and kelvin. But for some odd reason I'm just getting this as the output. What am I doing wrong? This is my output. 78 0 273.15 #include…
soniccool
  • 5,790
  • 22
  • 60
  • 98
0
votes
1 answer

Unit conversions return error message "could not find function "m_to_ft."

The "measurements" package should be installed and loaded. My first unit conversion (copied below) worked just fine: temp_f <- 100 temp_c <- F_to_C(temp_f) print(paste(temp_f, "ºF is equivalent to", temp_c, "ºC")) However, the following conversion…
Hades
  • 13
  • 3
0
votes
1 answer

Measurements Unit Conversion - Structure of Class in VB.net

I'm working on a Unit Conversion Module. I've found several good ideas here, as well as on CodeProject. My code looks very similar to this C# code at http://www.codeproject.com/KB/cs/Unit_Conversion_Sample.aspx From the following you'll probably…
GetFuzzy
  • 2,116
  • 3
  • 26
  • 42