Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

It seems that there is a lot of interest in enhancing the use of units in Mathematica; various solutions in the name of brevity, correctness, and general utility have been demonstrated. I've begun treating unit conversions in a very simple manner as listed below. My question: what problems might I run into making conversions in this manner? (It saves a little typing and seems somewhat easier to read to me, at the expense of defining "in" and "to" aliases.) (Mathematica v.9.0.1.0)

in = Quantity; to = UnitConvert;

Express x "in" feet:  

x = 100.0~in~"Feet"

100. ft

Convert "to" yards:

x~to~"Yards"

33.3333 yd

Convert to SI units:

x // to

30.48 m

"One stop shop" conversion:

x = 1.0~in~"kg"~to~"lb"

2.20462 lb
share|improve this question
    
If you really want to use this kind of syntax it would be easier to convert things using Google, IMO... Try this. –  Rod Jun 7 '13 at 0:31
    
Seems fine to me –  Rojo Jun 7 '13 at 1:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.