0
$\begingroup$

I want to print the expression $A[x] = 8020.6596 \times 1.055^x$ as is on a 2D graphic. I included the line

Graphics[Text[HoldForm[A[x] = 8020.6596 \[Times] 1.055^x],{2,0}]]

in the graphics call, but the first constant insists on printing as $8020.66$. How can I fix this problem?

$\endgroup$

2 Answers 2

1
$\begingroup$

Using NumberForm:

Graphics[{Inset[A[x] = NumberForm[8020.6596, 10]*1.055^x, {0, 0}]}]
$\endgroup$
1
  • $\begingroup$ This works, but you can't really use it along with, say, HoldForm. So if for example I wanted to output $x^{1/3} + 8020.6596\times 1.055^x$, I can't enclose the whole thing inside a HoldForm and still put the number inside a NumberForm. Why does this have to be so difficult, he whined? $\endgroup$
    – rogerl
    Commented Dec 19, 2013 at 22:54
1
$\begingroup$

You can use strings for such things. You can use fractional spaces to adjust spacing, style text using the Format menu, etc. This does't copy here very well but it is simple in a Notebook:

enter image description here

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.