# How do I extract units from an expression

I need to take the units off of this expression:

(5 Coulomb)/(6 Second)

In order to do some unit simplification. Is there any way to do this? I have tried Case, but could not get it to work properly. Because I cannot use these if they are put in a table, this is not helpful to me, so please do not mark this as duplicate; in order to be able to use them, I need them to remain one divided by the other.

EDIT: This question was marked as duplicate. Whoever did this misread my other question. This one is about extracting units from an expression and the other is about expressing a fraction in decimal form.

• Exact duplicate of your other question: Converting a quantity to a decimal form – MarcoB Jul 6 '15 at 20:06
• No it's not. Read what the question is about before marking it as duplicate. If you had done this, you would not have marked this as duplicate. – user3014065 Jul 6 '15 at 20:17

I think QuantityMagnitude and QuantityUnit are the functions you need. In your case,

a = Quantity[5, "Coulombs"]/Quantity[6, "Seconds"];
QuantityMagnitude[a]


Yields 5/6. If you want the units, use

QuantityUnit[a]


Which yields Coulombs/Seconds

• Is there a way to do the reverse of this? I want to end up with Coulombs/Seconds. – user3014065 Jul 6 '15 at 20:03