home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!think.com!ames!olivea!apple!applelink.apple.com
- From: GER.XSE0158@AppleLink.Apple.COM (Bergmann+Partner,DE,IDV)
- Newsgroups: comp.sys.mac.oop.macapp3
- Subject: Re: Draw (double)????
- Message-ID: <726773100.2867485@AppleLink.Apple.COM>
- Date: 11 Jan 93 17:13:00 GMT
- Sender: daemon@Apple.COM
- Organization: AppleLink Gateway
- Lines: 26
-
- Hello Bill,
-
- You wrote:
-
- > I'm tring to write a (double) into a view for display. Since NumToString
- > does only Integer conversion, I've tried the C function ecvt() which crashes
- > hard.
-
- Unless I can see your code, I will not be able to tell why your code crashes.
- But it can be done easily:
-
- I do not know in what view you wanted to draw the double. In a simple case I
- would use sprintf() to print it in a c-string and the put it into a TStaticText
- (which works fine with the CStr255-Constructors):
-
- char buffer [32]; // should be enough
- sprintf (buffer,"%Lf",myDouble);
- aStaticText -> SetText(buffer,kRedraw);
-
- If you want to care about international numbering you should use FormatX2Str().
- I Implemented a class TExtendedText which works quite similar to TNumberText
- (but has been used only once until now). Mail me if you are interested in
- the sources.
-
- Klaus Heck
-
-