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.

I'm doing a few calculations and would like to keep my units straight. I figured that using the built-in Units functionality could help with this. However, using SI prefixes doesn't seem to give the desired output.

I try executing this code:

 In[15]:= A = 4 Milli Meter*Pi*3^2 Micro Meter // N

And instead of getting, say, 113E-9 Meter^2, I get:

 Out[15]= 113.097 Meter^2 Micro Milli

Milli, Meter, and Micro are all globally defined names. What am I doing wrong?

share|improve this question

closed as off-topic by bobthechemist, Sjoerd C. de Vries, Mr.Wizard Feb 6 at 10:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – bobthechemist, Sjoerd C. de Vries, Mr.Wizard
If this question can be reworded to fit the rules in the help center, please edit the question.

Nopey, they are not :) Simple mistake, try: A = Quantity[4 , "Millimeters"] Quantity[Pi*3^2, "Micrometers"] // N which evaluates to Quantity[0.113097, ("Millimeters")^2] –  Sektor Feb 5 at 19:49
add comment

1 Answer 1

up vote 1 down vote accepted


ans = UnitConvert[Quantity[4 , "Millimeters"] Quantity[3^2 Pi, "Micrometers"]]

Mathematica graphics

EngineeringForm[N@ans, 6]

Mathematica graphics

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.