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)
Comments
Post a Comment