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/...
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 (...
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 ...
14
votes
Accepted
12
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 ...
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 ...
12
votes
Accepted
Quantity[] requires internet access. Is there any workarounds?
I have found by accident, that WL only requires internet if the form of the units is not conventional. In my example I should have used a plural form:
...
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:
<...
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 ...
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 -- ...
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|...
10
votes
Accepted
Change units in PlanetData["Earth", "Diameter"] from miles to km
You can use the UnitSystem option of EntityProperty,
...
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 ...
9
votes
Accepted
9
votes
Accepted
Problem using UnitConvert
"Revolutions" is not immediately recognized as a special unit. So, preprocess first with UnitSimplify[]:
...
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 ...
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 ...
9
votes
Accepted
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., ...
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/...
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
8
votes
Accepted
Exporting results containing Entities to JSON?
You can use "ConversionFunction" / "ConversionRules" for ...
8
votes
Accepted
How to find all InformationUnits by code method?
Select[QuantityUnits`$UnitList,
MemberQ[First /@ UnitDimensions[#], "InformationUnit"] &]
{ADSLDownstreamSpeed,ADSLUpstreamSpeed,...
8
votes
Accepted
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:
...
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 ...
7
votes
Format Time Reported by AbsoluteTiming
I think you need to add the HoldFirst attribute to your timing function, like this
...
7
votes
How to make Quantity remember interpretation?
I suggest using "Micrometers", but if not, this works in V13.0.1:
...
7
votes
Accepted
Why does System`Private`ConstructNoEntry[Quantity, 1, "kg"] enter a Recursion?
It is because KnownUnitQ["kg"] returns False, and hence Quantity tries to resolve <...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
units × 309plotting × 31
curated-data × 21
simplifying-expressions × 14
bugs × 14
physics × 14
formatting × 12
conversion × 10
physical-constants × 10
equation-solving × 9
date-and-time × 9
chemistry × 9
astronomy × 8
wolfram-alpha-queries × 7
list-manipulation × 6
calculus-and-analysis × 6
time-series × 6
finance × 6
functions × 5
precision-and-accuracy × 5
differential-equations × 4
graphics × 4
numerical-integration × 4
string-manipulation × 4
version-9 × 4