TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: SARAH NUNEZ
from: FRANK MASINGILL
date: 1997-03-31 21:37:00
subject: Formatting floats

    I know you are much further along than I am in learning C++ but thought 
I'd share something that with all of the aftermarket books and tutorials I 
have was not easy to find.
    In order to get a correct format of a float I found that I had to use 
something called "setprecision" which I think is prototyped in iomanip.h.  I 
don't know if there are any other ways of doing it or not.  Most of the 
example programs simply let it go at formatting a dollar amount to something 
like $25.00003 or something like that which was horrible.
    I guess they figure the student ought to concentrate on the BIG stuff 
first but I am just made so that I like for things to be formatted correctly 
in output.
                            Sincerely,
                                            Frank
--- FMail/386 1.02
---------------
* Origin: Maybe in 5,000 years frankmas@juno.com (1:396/45.12)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.