🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.oop.macapp3
Article #268

Re: Draw (double)????

#268
From: Bergmann+Partner,DE,IDV
Date: Mon, 11 Jan 1993 17:13
26 lines
1277 bytes
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
 
Technical Details
Message-ID: <726773100.2867485@AppleLink.Apple.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!olivea!apple!applelink.apple.com

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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