Draw Floating Point Numbers to TV Using Graphics Object?
Branmuffin Industries
Posts: 35
I am using the FloatMath.spin object to calculate floating point numbers.
I am using the Graphics, Numbers, and TV Object to draw a video out.
When I want to draw text to the Screen, I use:
gr.text(-90,70, String("DMC"))
or numbers to the screen, I use:
gr.text( 60, 90, Num.ToStr( stored[noparse][[/noparse]Temp], Num#DDEC))
When I want to draw Floating Point Numbers to the screen,
I want the screen to print values from 0.00 to 4.25, showing the decimal.
I can calculate them using:
f.FAdd( 2.1 , 3.4 )
but I have no way to convert it to a string for sending to the graphics object.
Can anyone help me out? Do I need to write a f.ToStr() function into the FloatMath object?
Thanks!
-Ryan Brandys
I am using the Graphics, Numbers, and TV Object to draw a video out.
When I want to draw text to the Screen, I use:
gr.text(-90,70, String("DMC"))
or numbers to the screen, I use:
gr.text( 60, 90, Num.ToStr( stored[noparse][[/noparse]Temp], Num#DDEC))
When I want to draw Floating Point Numbers to the screen,
I want the screen to print values from 0.00 to 4.25, showing the decimal.
I can calculate them using:
f.FAdd( 2.1 , 3.4 )
but I have no way to convert it to a string for sending to the graphics object.
Can anyone help me out? Do I need to write a f.ToStr() function into the FloatMath object?
Thanks!
-Ryan Brandys
Comments
Harrison
You normally use Float32, which is about 200 times faster..
However you need a trick to use Float32 and FloatString in harmony.. See the corresponding threads and there is also a first Q&A entry on this matter...
When I take FloatString back out, recompile myprogram, and look at the memory table, I have 6,261 longs free. My program is very small.
Since FloatString is only 368 longs, why does it tell me I am out of memory?
Thanks.