I have a function giving me this:
(5 Coulomb)/(6 Second)
as output. I want this in decimal form and would like to have the variables taken off the end for unit analysis. How would I do this? I have tried NumberForm
, but I think that the unassigned variables I am using for units are throwing it off.
EDIT: Here is what I have for code
In[1]: f[P_, V_] := P/V
In[2]: f[100 W, 120 V]
Out[2]:(5 Coulomb)/(6 Second)
I took your advice and put:
In[1]: f[P_, V_] := P/V
In[2]: f[100 W, 120 V]//N[#]&
And got:
Out[2]:(0.833333 Coulomb)/(Second)
N[(5 coulomb)/(6 second)]
gives me(0.833333 coulomb)/second
. You could add/. {coulomb -> 1, second -> 1}
at the end to get rid of thecoulomb
andsecond
. $\endgroup$Quantity[5, "Coulombs"]/Quantity[6, "Seconds"]
, then I don't get what you have. Could you make a small example and include code? More importantly, can you say what you mean by variables? I only see numbers and units.. $\endgroup$