If you have the room for libraries use snprintf. If not, maybe you can make
use of the IEEE floating point format to pick out the whole, decimal, and
exponent parts separately and print them as integers. That way you can avoid
floating point math.

-----Original Message-----
From: mspgcc-users-ad...@lists.sourceforge.net
[mailto:mspgcc-users-ad...@lists.sourceforge.net] On Behalf Of Pedro
Zorzenon Neto
Sent: Thursday, September 02, 2004 6:20 PM
To: mspgcc list
Subject: [Mspgcc-users] Converting float to string

Hi,

  I need to get a float variable and convert it to a string, with
this format: "1.234e+02" (1-digit dot 3-digits 'e' plus-or-minus
2-digits) -- I'll send it to a LCD display.

  Can you give me a hint?

  Thanks in advance,
    Pedro


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Reply via email to