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
3
votes
1 answer

Unit Converter C#

I have nothing else to do today so I decided to attempt to create a simple Unit Converter. So far, it's working well, but it's taking far too long due to my use of so many 'if' statements. I've searched the 'net for examples of Unit Converters made…
pcnThird
  • 2,362
  • 2
  • 19
  • 33
2
votes
1 answer

In Google Sheets, how do we take a decimal feet value and turn it into properly formatted fractional Feet & Inches?

Been looking all over and nothing comes up as far as a Google Sheets formula. Let's say we have a value of 3.6875 feet. We can use the number format # ??/??, but it will give us a fractional value in feet (in this case, 3 11/16 feet). How do we…
2
votes
1 answer

How to handle unit conversions while interacting with FMUs?

I have a python script that filters and lists the parameters, their units and default values from a fmu using the read_model_description function from FMPy library and writes in an excel sheet (related discussion). Then using the simulate_fmu…
Kaustubh
  • 391
  • 2
  • 10
2
votes
1 answer

Unit Of Measures API (JSR-363) - Floating Point Errors

We are using tec.units.unit-ri as an implementation of the JSR-363, javax.measure.unit-api. We are using several weight-, length- and temperature- types in our application and we decided to use BigDecimal to store them. While doing some…
javahippie
  • 806
  • 10
  • 25
2
votes
2 answers

Conversion Between Fahrenheit and Celsius ISSUE

i have this problem from a beginning c sharp book this for conversion between Fahrenheit and Celsius. private void button1_Click(object sender, EventArgs e) { float fahr, cel; if (Celsius.Checked == true) { fahr =…
user527825
  • 23
  • 1
  • 5
2
votes
2 answers

Unit conversion - Amazon API

Amazon API returns strange dimensions. On the website, they have displayed: Product Dimensions: 8.7 x 7.9 x 0.6 inches ; 1.8 ounces Shipping Weight: 4 ounces while the API returns: [ItemDimensions] => Array ( [Height] => 59 [Length] => 866 …
eozzy
  • 66,048
  • 104
  • 272
  • 428
2
votes
2 answers

How do I prevent jQuery Accidental Unit Conversion

Let's say I have the code: var $element = $('
'); $element.css("margin-left", "2cm"); console.log($element.css("margin-left")); Chrome gives me nothing, and Firefox gives me "75.5833px". Any ideas about how to fix/work around this? I…
AaronF
  • 2,841
  • 3
  • 22
  • 32
2
votes
2 answers

Google Docs Pixels to Inches

Is anyone aware of the formula google docs use to convert pixels to inches? Right click on a cell and click table properties then you get the image below, note I have opened up firebug and you can clearly see each td is set with a px width. I can…
Haroon
  • 3,402
  • 6
  • 43
  • 74
1
vote
4 answers

Prettifying a conversion from m(metres) to feet(') and inches ('')

I'm creating table for defining an individual's BMI. The chart (as yet) doesn't take input (because I want to make the thing work stand-alone, first), but it does show (on parallel axes) the height in both metres and feet/inches. In order to do this…
David Thomas
  • 249,100
  • 51
  • 377
  • 410
1
vote
0 answers

How to convert units for all tags in a SVG using Inkscape Command Line or Python 3?

I use mm as my unit while creating SVG drawings in INKSCAPE and for a program I'm working on, I need units of all the shapes to be converted to pts Is there any way to convert the units of every xml tag in the SVG from mm to pt most preferably using…
Pervez
  • 391
  • 1
  • 10
1
vote
1 answer

Convert character variable of height (5ft6in) into numeric variable in inches?

I would like to convert a height variable I have from character type to numeric. for context, this is so I can use the values to calculate body mass index. Looking at the below example data frame, I would like to convert Height_1 into Height_2…
Aepkr
  • 101
  • 8
1
vote
0 answers

issue implementing an approximation for the sun's position and coordinate system conversions

I'm trying to implement the Astronomical Almanac's approximation of the sun's position. My code looks like this: var now := OS.get_datetime() var lat := deg2rad(player_latlon.x) var lon := deg2rad(player_latlon.y) ### Astronomical Almanac,…
nonchip
  • 1,084
  • 1
  • 18
  • 36
1
vote
1 answer

How derive a formula for (measurement) unit conversion of arbitrary compound units?

I'm developing a calculator application which also does allow to convert between units. For this I want to provide the feature to not only convert between arbitrary (measurement) units, but also between arbitrary compound units, like km/h to m/s.…
Bobby
  • 11,419
  • 5
  • 44
  • 69
1
vote
1 answer

How do I convert well log measured depth to feet in Ocean for Petrel?

I want to export a well log from a Slb.Ocean.Petrel.DomainObject.Well.WellLog to an external file, but the the measured depth I get is in meters even if the project is set up to use feet. I can convert the well log samples with the converter I get…
Hallgrim
  • 15,143
  • 10
  • 46
  • 54
1
vote
2 answers

Convert Mixed Unit Measurements

I have a file with large range of non-standardised mixed imperial and metric measurements, which I want to standardise and republish. A sample of that range looks like this: df <- data.frame(Measurements =c("1.25m", "2 Feet", "3 Inches", "5.5…
rsylatian
  • 429
  • 2
  • 14