Click here to Skip to main content
15,926,857 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: conversion confusion... Pin
GDavy23-Jun-05 22:20
GDavy23-Jun-05 22:20 
GeneralRe: conversion confusion... Pin
Rage23-Jun-05 21:51
professionalRage23-Jun-05 21:51 
GeneralRe: conversion confusion... Pin
GDavy23-Jun-05 22:03
GDavy23-Jun-05 22:03 
GeneralRe: conversion confusion... Pin
mekanoo23-Jun-05 22:33
mekanoo23-Jun-05 22:33 
GeneralRe: conversion confusion... Pin
mekanoo23-Jun-05 22:53
mekanoo23-Jun-05 22:53 
GeneralRe: conversion confusion... Pin
GDavy23-Jun-05 23:21
GDavy23-Jun-05 23:21 
GeneralRe: conversion confusion... Pin
mekanoo24-Jun-05 0:13
mekanoo24-Jun-05 0:13 
GeneralRe: conversion confusion... Pin
Gary R. Wheeler24-Jun-05 3:25
Gary R. Wheeler24-Jun-05 3:25 
void AFunction(double dNumber,int acc)
{
  int nDecimal = (int)dNumber;
  double dFract = dNumber - (double)nDecimal;
  double dFactor = 1.0;
  for (int dFi = 0; dFi < acc; dFi++) dFactor *= 10.0;
  int nFract = (int)((dFract * dFactor) + 0.5);
}
Hmm. I made the scale factor a double, and calculated it with a simple loop (the fastest solution would be to use an array lookup). I also rounded the result.


Software Zen: delete this;
GeneralRe: conversion confusion... Pin
mekanoo25-Jun-05 2:32
mekanoo25-Jun-05 2:32 
GeneralWorking with Media Files Pin
Adeel68823-Jun-05 20:51
Adeel68823-Jun-05 20:51 
GeneralCFile---reda write Pin
a_du23-Jun-05 20:02
a_du23-Jun-05 20:02 
GeneralRe: CFile---reda write Pin
ThatsAlok23-Jun-05 21:14
ThatsAlok23-Jun-05 21:14 
GeneralRe: CFile---reda write Pin
Priyank Bolia23-Jun-05 21:29
Priyank Bolia23-Jun-05 21:29 
GeneralCOMPARE 2 Strings Pin
ana_bahy23-Jun-05 20:02
ana_bahy23-Jun-05 20:02 
GeneralRe: COMPARE 2 Strings Pin
Maxwell Chen23-Jun-05 20:32
Maxwell Chen23-Jun-05 20:32 
GeneralRe: COMPARE 2 Strings Pin
Weiye Chen23-Jun-05 20:36
Weiye Chen23-Jun-05 20:36 
GeneralRe: COMPARE 2 Strings Pin
ana_bahy23-Jun-05 20:42
ana_bahy23-Jun-05 20:42 
GeneralRe: COMPARE 2 Strings Pin
toxcct23-Jun-05 20:49
toxcct23-Jun-05 20:49 
GeneralRe: COMPARE 2 Strings Pin
ana_bahy23-Jun-05 20:58
ana_bahy23-Jun-05 20:58 
GeneralRe: COMPARE 2 Strings Pin
toxcct23-Jun-05 21:00
toxcct23-Jun-05 21:00 
GeneralRe: COMPARE 2 Strings Pin
ana_bahy23-Jun-05 21:14
ana_bahy23-Jun-05 21:14 
GeneralRe: COMPARE 2 Strings Pin
Maxwell Chen23-Jun-05 21:14
Maxwell Chen23-Jun-05 21:14 
GeneralRe: COMPARE 2 Strings Pin
GDavy23-Jun-05 21:15
GDavy23-Jun-05 21:15 
GeneralRe: COMPARE 2 Strings Pin
ana_bahy23-Jun-05 21:25
ana_bahy23-Jun-05 21:25 
GeneralEntry and exit (When Exit its does entry) Pin
Cillieacc0rd5o423-Jun-05 19:46
Cillieacc0rd5o423-Jun-05 19:46 

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.