Click here to Skip to main content
16,005,149 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Debug Without other Threads Stopped! [modified] Pin
toxcct14-Feb-07 3:12
toxcct14-Feb-07 3:12 
Questionediting read-only files Pin
ibtt114-Feb-07 2:52
ibtt114-Feb-07 2:52 
AnswerRe: editing read-only files Pin
toxcct14-Feb-07 2:57
toxcct14-Feb-07 2:57 
GeneralRe: editing read-only files Pin
jhwurmbach14-Feb-07 3:19
jhwurmbach14-Feb-07 3:19 
GeneralRe: editing read-only files Pin
ibtt114-Feb-07 4:32
ibtt114-Feb-07 4:32 
AnswerRe: editing read-only files Pin
jhwurmbach14-Feb-07 3:21
jhwurmbach14-Feb-07 3:21 
QuestionBItmap trail Pin
ceejeeb14-Feb-07 2:23
ceejeeb14-Feb-07 2:23 
QuestionRounding numbers (both ways) Pin
Johpoke14-Feb-07 1:35
Johpoke14-Feb-07 1:35 
Im in a C++ MFC visual studio 6.0 workspace. i have a float, which i need to round, both mathematically and string wise..
For example mathematically this;

0.306-> 0.31
0.99-> 1.00

and string wise;

0.12000000 -> 0.12
12.0000000 -> 12

Ive surfed around, but only found ones that dont remove unnecessary zeros, and dont work perfectly for all numbers..

The variable i have is a float, and im guessing its atof thats creating the extra zeros (which i have to use, or something equivalent)

rounding should be to 2dp, ie allways x.xx

any ideas?

thanks!



/Johannes

AnswerRe: Rounding numbers (both ways) Pin
jhwurmbach14-Feb-07 1:45
jhwurmbach14-Feb-07 1:45 
AnswerRe: Rounding numbers (both ways) Pin
toxcct14-Feb-07 2:03
toxcct14-Feb-07 2:03 
AnswerRe: Rounding numbers (both ways) Pin
David Crow14-Feb-07 2:21
David Crow14-Feb-07 2:21 
AnswerRe: Rounding numbers (both ways) Pin
-Dy14-Feb-07 2:21
-Dy14-Feb-07 2:21 
AnswerRe: Rounding numbers (both ways) Pin
#realJSOP14-Feb-07 10:25
professional#realJSOP14-Feb-07 10:25 
GeneralRe: Rounding numbers (both ways) Pin
Johpoke14-Feb-07 2:29
Johpoke14-Feb-07 2:29 
GeneralRe: Rounding numbers (both ways) Pin
toxcct14-Feb-07 2:30
toxcct14-Feb-07 2:30 
QuestionRe: Rounding numbers (both ways) Pin
Johpoke14-Feb-07 2:33
Johpoke14-Feb-07 2:33 
QuestionApplication Startup Pin
Robin Imrie14-Feb-07 1:22
professionalRobin Imrie14-Feb-07 1:22 
AnswerRe: Application Startup Pin
_AnsHUMAN_ 14-Feb-07 1:52
_AnsHUMAN_ 14-Feb-07 1:52 
GeneralRe: Application Startup Pin
Robin Imrie14-Feb-07 2:40
professionalRobin Imrie14-Feb-07 2:40 
QuestionRe: Application Startup Pin
David Crow14-Feb-07 2:22
David Crow14-Feb-07 2:22 
AnswerRe: Application Startup Pin
Robin Imrie14-Feb-07 2:44
professionalRobin Imrie14-Feb-07 2:44 
GeneralRe: Application Startup Pin
David Crow14-Feb-07 3:26
David Crow14-Feb-07 3:26 
GeneralRe: Application Startup Pin
Robin Imrie14-Feb-07 3:35
professionalRobin Imrie14-Feb-07 3:35 
QuestionRe: Application Startup Pin
David Crow14-Feb-07 3:53
David Crow14-Feb-07 3:53 
AnswerRe: Application Startup Pin
Robin Imrie14-Feb-07 4:08
professionalRobin Imrie14-Feb-07 4:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.