Group Abstract Group Abstract

Message Boards Message Boards

Unexpected result from TravelTime[ ]

Posted 1 year ago
POSTED BY: Claude Mante

TravelTime already returns results as a (MixedUnited) Quantity, so wrapping the results in Quantity is going to end up doing quantity arithmetic (in this case, an implicit times operation):

In[32]:= Quantity[Quantity[3, "Feet"], "Meters"]

Out[32]= Quantity[1250/127, ("Feet")^2]

To convert the results to minutes, use UnitConvert (or QuantityMagnitude if you just want the numeric value)instead:

In[10]:= UnitConvert[
 Quantity[MixedMagnitude[{3, 8}], 
  MixedUnit[{"Hours", "Minutes"}]], "Minutes"]

Out[10]= Quantity[188, "Minutes"]

In[11]:= QuantityMagnitude[
 Quantity[MixedMagnitude[{3, 8}], 
  MixedUnit[{"Hours", "Minutes"}]], "Minutes"]

Out[11]= 188
POSTED BY: Nick Lariviere
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard