19 votes
Accepted

Conversion between GB and MB (and KB)

You need to use 'better' units: UnitConvert[Quantity[1, "GiB"], "MiB"] Quantity[1024, "Mebibytes"] See explanation and definitions in https://en.wikipedia.org/...
Kuba's user avatar
  • 137k
19 votes

Why are Quantity and Units inconsistent with regular Mathematica behavior?

Not a solution but an extended comment. You misunderstand the physical underpinnings of quantities and units. Every physical quantity has an inherent margin of error, even if it is very small (...
Roman's user avatar
  • 47.5k
14 votes

How to get Planck length in meters to 6 decimal places

You can use the relative uncertainty 1.1*10^-5 from the CODATA website you also referenced, and use Around to construct a value ...
Thies Heidecke's user avatar
14 votes
Accepted

How to have the units for energy show as kW h instead of h kW?

...
xzczd's user avatar
  • 66.2k
12 votes

Why is Mathematica messing with the time units in this simple equation?

First, regarding the substance of the calculation apart from Mathematica's unit handling: I think your input suggests some confusion about what you're trying to calculate. You say your working days ...
nanoman's user avatar
  • 249
11 votes

Unit Discovery: Is this some sort of a sick joke?

A bit too long for a comment... My best guess is that WolframAlpha["earth's gravity", "MathematicaResult"] is simply rounding to too few digits. It returns ...
Greg Hurst's user avatar
11 votes
Accepted

Convert radian to degree and add °

I resolved that using (Pi/4) * (180 Degree /Pi) Degree is a symbol similar to Pi, it ...
Ale1794's user avatar
  • 525
11 votes

How to summon Acceleration due to Gravity in Mathematica 11?

Rightly or wrongly, if the unit specification is unknown, then WA is used behind the scenes to decide if it could be interpreted as a standard unit. You can see this with the error message provided: <...
Carl Woll's user avatar
  • 131k
11 votes
Accepted

How to get Planck length in meters to 6 decimal places

The 4.652... at the end of 1.61625500000000006684132`4.652207380644164*^-35 should tell you that Mathematica knows this constant ...
Henrik Schumacher's user avatar
11 votes

Why are Quantity and Units inconsistent with regular Mathematica behavior?

Is Mathematica V4 still for sale? This answer proposes less drastic solutions than moving back for Version 4. "Global" solution For the problems you encounter and approach you take one -- ...
Anton Antonov's user avatar
10 votes
Accepted

Bug recognizing "Wavenumbers" as a unit of energy?

As noted in the comments, inverse centimeters do not have dimensions of energy, unless you consider $h$ and $c$ to be dimensionless, which Mathematica has no way to tell that you are doing. (Wolfram|...
Simon Rochester's user avatar
10 votes
Accepted

Change units in PlanetData["Earth", "Diameter"] from miles to km

You can use the UnitSystem option of EntityProperty, ...
Jason B.'s user avatar
  • 68.4k
9 votes
Accepted

Working with degrees minutes and seconds without conversion

You may use either MixedRadixQuantity or Quantity with MixedMagnitude and ...
Edmund's user avatar
  • 42.3k
9 votes
Accepted

Plotting with units: emits error and gives incorrect plot

Look at what this gives: Evaluate[h[x]/Hinf] This is clearly wrong, you're adding x of no quantity to a quantity of ...
Feyre's user avatar
  • 8,597
9 votes

Physical (and other) constants

You can look through all of the units for the ones that are physical constants: Quantity@"m"; Sort@Keys@QuantityUnits`Private`$UnitReplacementRules (You need the ...
Mark Adler's user avatar
  • 4,949
9 votes
Accepted

Mathematica function which formats Physics calculation

...
Mike Honeychurch's user avatar
9 votes
Accepted

Problem using UnitConvert

"Revolutions" is not immediately recognized as a special unit. So, preprocess first with UnitSimplify[]: ...
J. M.'s missing motivation's user avatar
9 votes

Mathematica seems confused about Kilograms vs KilogramsForce

Under the hood, units not recognized by Quantity use Wolfram|Alpha's NLP to parse the unit. In this case we see there are 2 possibilities: It's probably worth ...
Greg Hurst's user avatar
9 votes
Accepted

Why is Mathematica messing with the time units in this simple equation?

"Hours", "Weeks" and "Years" are all time units: UnitDimensions /@ {"Hours", "Weeks", "Years"} {{{"TimeUnit", 1}}, {{"TimeUnit", 1}}, {{"TimeUnit", 1}}} It is ...
Carl Woll's user avatar
  • 131k
9 votes
Accepted

Why do expressions with physical units not get simplified?

...
Bob Hanlon's user avatar
  • 158k
9 votes
Accepted

Dimensionless units like Percent are not treated consistently by functions like Exp or Log. How can pitfalls be avoided?

While the approaches in the comments (thanks a lot!) solve the issue, the question triggered me to try to "have my cake and eat it as well", i.e., enter quantities but decide globally ...
8 votes

FindMinimum with units?

You use x as a pure number (e.g., Quantity[x, "cm"]) and as a Quantity object (e.g., ...
Carl Woll's user avatar
  • 131k
8 votes
Accepted

Convert natural unit to SI unit

A few months ago I wrote a function that converts from SI to natural units. A quick way to achieve the inverse conversion is to convert your target units, meters, to natural units to get about 5e6 1/...
LouisB's user avatar
  • 12.5k
8 votes

Why is Mathematica messing with the time units in this simple equation?

This is the computation you really want: Quantity[40, "Hours"/"Weeks"]Quantity[251/7, "Weeks"] Quantity[10040/7, "Hours"] r
m_goldberg's user avatar
  • 108k
8 votes
Accepted

Exporting results containing Entities to JSON?

You can use "ConversionFunction" / "ConversionRules" for ...
Kuba's user avatar
  • 137k
8 votes
Accepted

How to find all InformationUnits by code method?

Select[QuantityUnits`$UnitList, MemberQ[First /@ UnitDimensions[#], "InformationUnit"] &] {ADSLDownstreamSpeed,ADSLUpstreamSpeed,...
yode's user avatar
  • 26.7k
7 votes

Unitless quantities

Perhaps you can use "Unities" or "PureUnities". The unit "PureUnities" automatically gets turned into a number, while "Unities" needs a UnitConvert: ...
Carl Woll's user avatar
  • 131k
7 votes
Accepted

How to add some bytes quantity?

Yes, so first we convert them into quantities: quantities = Interpreter[Restricted["Quantity", "Megabytes"]][st] Now we can eg add them with ...
Carl Lange's user avatar
  • 13.1k
7 votes

Format Time Reported by AbsoluteTiming

I think you need to add the HoldFirst attribute to your timing function, like this ...
LouisB's user avatar
  • 12.5k

Only top scored, non community-wiki answers of a minimum length are eligible