🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.mac.oop.macapp3
1 messages
1 total messages Started by Bergmann+Partner,DE,IDV Mon, 11 Jan 1993 17:13
Re: Draw (double)????
#268
Author: 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
 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads