You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Quantity(string) to parse a user-provided string corresponding to a quantity, I'm having a few issues when multiple quantities are set for the same dimensionality but different units. In particular, if a phrase contains multiple quantities for the same dimensionality, they are multiplied instead of added, even though the natural form of that phrase is typically interpreted as an addition.
For example, 20.5 minutes works, 20 minutes + 30 seconds works (and is equivalent), but 20 minutes 30 seconds is parsed as 600 minutes * seconds. Similarly, 6 ft 9 in is converted to 54 ft * in instead of 6.75 ft. Same for 6 ft, 9 in.
Is this by design? Is there a way to cause the parsing to prioritize addition instead of where appropriate, or based on a specific dimensionality (e.g., if dimensionality is length use the interpretation that leads to length)?
The text was updated successfully, but these errors were encountered:
When using
Quantity(string)
to parse a user-provided string corresponding to a quantity, I'm having a few issues when multiple quantities are set for the same dimensionality but different units. In particular, if a phrase contains multiple quantities for the same dimensionality, they are multiplied instead of added, even though the natural form of that phrase is typically interpreted as an addition.For example,
20.5 minutes
works,20 minutes + 30 seconds
works (and is equivalent), but20 minutes 30 seconds
is parsed as600 minutes * seconds
. Similarly,6 ft 9 in
is converted to54 ft * in
instead of 6.75 ft. Same for6 ft, 9 in
.Is this by design? Is there a way to cause the parsing to prioritize addition instead of where appropriate, or based on a specific dimensionality (e.g., if dimensionality is length use the interpretation that leads to length)?
The text was updated successfully, but these errors were encountered: