1

When I type:

QuantityMagnitude[3.4 m]

I got only the same sentence as a result. I am expecting 3.4

Trying to figure out what is not working, N[Sqrt[2]] produced, as expected: 1.41421. What might be wrong here?

pigeon
  • 43
  • 6
  • 1
    You probably didn't type the unit correctly. See here: http://reference.wolfram.com/language/ref/Quantity.html – Szabolcs Mar 08 '20 at 10:13
  • I had seen that, but m was also mentioned here: https://reference.wolfram.com/language/ref/QuantityMagnitude.html , but it did not work for me. I got it now working typing "earth gravity" in free-from and then QuantityMagnitude[%]. – pigeon Mar 08 '20 at 10:20
  • Did you type the unit as described in the reference page I linked? Or did you literally type 3.4 m? – Szabolcs Mar 08 '20 at 10:25
  • You linked to Quantity but we are talking about QuantityMagnitude (which I had linked to in my later comment). this are different. – pigeon Mar 08 '20 at 11:23
  • You did not answer my question. I linked to the reference page describing how to enter units. – Szabolcs Mar 08 '20 at 13:30
  • All evidence so far indicates that you simply typed the unit incorrectly (neither with Ctrl-= nor with an explicit Quantity and a valid unit name). Voting to close as simple mistake. If my assumption is incorrect, please describe the problem in more detail, and indicate how you entered the unit precisely. – Szabolcs Mar 08 '20 at 13:31
  • 3
    The input to QuantityMagnitude must be a Quantity. Copy and paste the example from the documentation, then convert it to InputForm you will see

    QuantityMagnitude[Quantity[3.4, "Meters"]]

    – Bob Hanlon Mar 08 '20 at 14:58
  • 1
    Thanks @BobHanlon , But this is very ambiguous from the documentation, unless this followed a rule of which I am not aware. It seams this is a way to implicitly include something and just link to it. Thanks. – pigeon Mar 08 '20 at 20:09

0 Answers0