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
0
votes
0 answers

Storing Units in @AppStorage

I need to store a user's chosen selection of 11 different measurement units in AppStorage. Ideally something equivalent to: @AppStorage("shortDistance") var shortDistance: UnitLength = .meters I understand why this won't work, but need to do this…
MarkCX
  • 11
  • 3
0
votes
1 answer

Converting cgs to 'custom' units in Astropy

I have the following from astropy import units as u from astropy.modeling.models import BlackBody bb = BlackBody(temperature=303.15*u.K) wav = np.arange(1.0, 50.0) * u.micron flux = bb(wav) where flux has units: erg / (cm2 Hz s sr) I'd like to…
npross
  • 1,756
  • 6
  • 19
  • 38
0
votes
0 answers

Convert mm (metric) to imperial (fraction) in c#

public class Convert { public void MMtofeetfraction(float millimeters) { if ((millimeters % 304.8f) != 0) { int feet = (int)(millimeters / 304.8f); double inchWithDecimal = millimeters * 0.03937; …
0
votes
4 answers

Convert from pounds to kilograms, possibly using Core Data

In my app, numbers are displayed as pounds. I need to add an option to use kilograms instead. Does anyone know how to go about this? I'm using Core Data to store numbers. I know I can do it all manually by using an if statement then doing a…
user594161
0
votes
1 answer

Json field dependency for unit conversion

I have this json schema defined : "type": "object", "properties": { "kg": { "type": "number", "multipleOf": 0.01, }, "lbs": { "type": "number", …
Flamingo09
  • 11
  • 1
0
votes
2 answers

Convert Excel column width between characters unit and pixels (points)

"One unit of column width is equal to the width of one character in the Normal style. For proportional fonts, the width of the character 0 (zero) is used." So ColumnWidth in Excel is measured as a number of "0" characters which fits in a column. How…
Winand
  • 2,093
  • 3
  • 28
  • 48
0
votes
0 answers

How do I convert units in R from °C (for temperature) and % change (for precipitation)?

The data set is described as based on the CMIP5 model ensemble, and represents the average temperature and precipitation change expected at approximately 2.8x2.8 degrees resolution in latitude/longitude. In this case, however, the data has been…
0
votes
0 answers

Using ipywidgets to make a unit converter

I have an assignment to use ipywidgets and the inputs value.value, convertFrom.value, and convertTo.value in Jupyter to convert any unit into another unit without building an "internal two-dimensional table structure of the conversion of every unit…
0
votes
1 answer

How does rasa achieve unit conversion

I want to use rasa to achieve unit conversion.But now there are many units,like time,digital,length,mass,temperature,volume.And like the length unit has a lot, such as meters, kilometers, centimeters.There are many situations in combination. How can…
shaojie
  • 121
  • 1
  • 11
0
votes
1 answer

The best way to calculate (javascript) pixels from a unit representation (rem/vh/px/...)

Looking for a simple yet robust way to calculate pixel length from any string such as: "55rem" / "33vh" / "300px" to the current browser in pixels. From what I understand there is window.getComputedStyle(), but I don't want the style to be attached…
rubmz
  • 1,947
  • 5
  • 27
  • 49
0
votes
3 answers

Python internal metric unit conversion function

I'm trying to build a function to do internal metric conversion on a wavelength to frequency conversion program and have been having a hard time getting it to behave properly. It is super slow and will not assign the correct labels to the output. If…
0
votes
1 answer

How to convert between frequency and period in Pint?

I would like to be able to convert between frequency values and period values. These are not directly convertible since they are not exactly the same unit, but I read that there are predefined relationships between units called Contexts. However, I…
mlg556
  • 419
  • 3
  • 13
0
votes
2 answers

How to create a program to convert unit measurements

Using Microsoft access, visual basic. I'm having a big problem doing this task. What I have done: Created a table on access where I have put measurements in (from meters): mile = 10000meters, nautic mile = 1862meters, English mile=1652, kilometers…
kabakka
  • 9
  • 4
0
votes
0 answers

Implementing a simple unit converter

I'm new to Angular so please excuse my neewbie questions :) I'm creating a small project to show some sport trainings data. I need to implement a simple converter for units like speed, distance etc. For now, i have created a Pipe that calculates the…
KLabedz
  • 1
  • 2
0
votes
1 answer

lux to lumen BH1750 I2C light sensor

my BH1750 I2C light sensor is giving me a reading in lux but I need a lumen-value. From what I read I just multiply the lux-reading by the surface area of the sensor to get my lumen-value. But from the datasheet on page 6 I'm getting a very small…
C. Winters
  • 49
  • 1
  • 8