Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Feb 7th, 2007, 1:15 AM   #1
programmingnoob
Hobbyist Programmer
 
Join Date: Feb 2006
Posts: 155
Rep Power: 3 programmingnoob is on a distinguished road
float - cut down digts?

you know if you do float x = 12/12.0;
it'll give you x = 1.00000

now what do i do if i want to cout the result at 1.0

do I have to convert x into a string and take out "characters" or what? that just doesnt sound very sophiscated
i feel there is better approach to it?
programmingnoob is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I take a square root? Fall Back Son C 26 Oct 23rd, 2006 1:24 PM
converting string to float beginnerCCC C 22 Oct 3rd, 2006 12:59 AM
PLEASE HELP Convert FLOAT to STRING Pedro C 2 May 23rd, 2005 11:55 AM
Two ints divided into a float. Dygear C++ 2 Apr 1st, 2005 6:42 PM
float precision and MFC... Racine_ C++ 0 Feb 5th, 2005 9:31 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:36 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC