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$
4
  • $\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, 2014 at 2:07
  • $\begingroup$ possible duplicate: mathematica.stackexchange.com/q/783/5 $\endgroup$
    – rm -rf
    Jan 8, 2014 at 2:14
  • $\begingroup$ thanks, that duplicate is correct and helpful $\endgroup$
    – squirrat
    Jan 8, 2014 at 2:23
  • $\begingroup$ You're welcome :) $\endgroup$
    – rm -rf
    Jan 8, 2014 at 2:25

0

Browse other questions tagged or ask your own question.