0
$\begingroup$

I have a Variable assigned a value, say

ImportantDocuments=1

How do I make

N["ImportantDocuments"]

evaluate to be

1

instead of

ImportantDocuments

I found that

N[ToExpression["ImportantDocuments"]]

gives the correct answer.

$\endgroup$
  • $\begingroup$ To be pedantic, it is not possible to do that, since N[...] will give you 1., not 1 :D Jokes aside, to answer your question, look up Symbol and ToExpression. $\endgroup$ – rm -rf Jan 8 '14 at 2:07
  • $\begingroup$ possible duplicate: mathematica.stackexchange.com/q/783/5 $\endgroup$ – rm -rf Jan 8 '14 at 2:14
  • $\begingroup$ thanks, that duplicate is correct and helpful $\endgroup$ – user2019001 Jan 8 '14 at 2:23
  • $\begingroup$ You're welcome :) $\endgroup$ – rm -rf Jan 8 '14 at 2:25