Thanks Folks,
Now I need to go the other way. That is, have a textBox display a
representation of a double precision number. I have tried (amoung other
things):
textBox2->Text=F.ToString;
all resulting in errors unintelegible by me.

Signature
mark b
Nathan Mates - 05 Apr 2007 05:15 GMT
>Now I need to go the other way. That is, have a textBox display a
>representation of a double precision number. I have tried (amoung other
>things):
> textBox2->Text=F.ToString;
Once again, the tried and true method in C/C++ is sprintf.
Don't knock it until you've tried it. For example:
char tempStr[128];
sprintf_s(tempStr, "%g", value);
Simple, portable (well, except for the _s part), and has more
possible options than you can shake a stick at.
Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
Cholo Lennon - 05 Apr 2007 07:04 GMT
If you want a C++ way (and not C (like Nathan Mates' solution) or .Net way), you can use stringstream or wstringstream (sprintf is
faster but is not type safe). See interpret_cast in Kevlin Henney's paper (Valued Conversions,
http://www.two-sdg.demon.co.uk/curbralan/papers/ValuedConversions.pdf). Also see lexical_cast (from the same author) in boost
libraries for an updated and more complete version of interpret_cast (http://www.boost.org/libs/conversion/lexical_cast.htm). These
converter templates are very flexible, simple and useful.
Regards
--
Cholo Lennon
Bs.As.
ARG
> Thanks Folks,
>
[quoted text clipped - 5 lines]
>
> all resulting in errors unintelegible by me.
Ben Voigt - 05 Apr 2007 14:41 GMT
> Thanks Folks,
>
[quoted text clipped - 3 lines]
>
> textBox2->Text=F.ToString;
ToString is a function, not a property. The () are not optional in C++.
textBox2->Text=F.ToString();