Click here to Skip to main content
15,890,947 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDBCtrlGrid Record specific display Pin
Debs*28-Jun-06 4:15
Debs*28-Jun-06 4:15 
QuestionAlgorithm Request Pin
Barry Etter28-Jun-06 4:00
Barry Etter28-Jun-06 4:00 
AnswerRe: Algorithm Request Pin
_AnsHUMAN_ 28-Jun-06 4:08
_AnsHUMAN_ 28-Jun-06 4:08 
GeneralRe: Algorithm Request Pin
Sarath C28-Jun-06 4:10
Sarath C28-Jun-06 4:10 
GeneralRe: Algorithm Request Pin
_AnsHUMAN_ 28-Jun-06 4:16
_AnsHUMAN_ 28-Jun-06 4:16 
GeneralRe: Algorithm Request Pin
Sarath C28-Jun-06 4:21
Sarath C28-Jun-06 4:21 
GeneralRe: Algorithm Request Pin
Jörgen Sigvardsson28-Jun-06 14:22
Jörgen Sigvardsson28-Jun-06 14:22 
AnswerRe: Algorithm Request Pin
krmed28-Jun-06 4:20
krmed28-Jun-06 4:20 
For the number of digits before the decimal, you could use
int iNumBefore = 0;<br />
iNumBefore = 1 + (int)(log10(x));

where x is your value

As for the number of digits after, I don't have any quick ideas on that, but as you say, you could convert to a string (although you might get different results because of the precision of doubles) and then find the decimal.

Hope that helps.

Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
GeneralRe: Algorithm Request Pin
Francesco Aruta28-Jun-06 4:53
Francesco Aruta28-Jun-06 4:53 
AnswerRe: Algorithm Request Pin
Cedric Moonen28-Jun-06 4:23
Cedric Moonen28-Jun-06 4:23 
GeneralRe: Algorithm Request Pin
Francesco Aruta28-Jun-06 4:46
Francesco Aruta28-Jun-06 4:46 
AnswerRe: Algorithm Request [modified] Pin
Viorel.28-Jun-06 4:27
Viorel.28-Jun-06 4:27 
GeneralRe: Algorithm Request Pin
Sarath C28-Jun-06 4:42
Sarath C28-Jun-06 4:42 
GeneralRe: Algorithm Request Pin
Viorel.28-Jun-06 4:49
Viorel.28-Jun-06 4:49 
AnswerRe: Algorithm Request Pin
kylur28-Jun-06 4:28
kylur28-Jun-06 4:28 
GeneralRe: Algorithm Request [modified] Pin
Tnarol28-Jun-06 5:20
Tnarol28-Jun-06 5:20 
AnswerRe: Algorithm Request Pin
Chris Losinger28-Jun-06 5:41
professionalChris Losinger28-Jun-06 5:41 
AnswerRe: Algorithm Request [modified] Pin
Zac Howland28-Jun-06 6:18
Zac Howland28-Jun-06 6:18 
AnswerRe: Algorithm Request Pin
Rilhas9-Jul-06 6:25
Rilhas9-Jul-06 6:25 
QuestionFileMapping problem Pin
Kharfax28-Jun-06 3:51
Kharfax28-Jun-06 3:51 
AnswerRe: FileMapping problem Pin
Matt Godbolt28-Jun-06 4:07
Matt Godbolt28-Jun-06 4:07 
GeneralRe: FileMapping problem Pin
Kharfax28-Jun-06 4:38
Kharfax28-Jun-06 4:38 
AnswerRe: FileMapping problem Pin
Jun Du28-Jun-06 7:12
Jun Du28-Jun-06 7:12 
GeneralRe: FileMapping problem Pin
Kharfax28-Jun-06 7:37
Kharfax28-Jun-06 7:37 
GeneralRe: FileMapping problem Pin
Kharfax28-Jun-06 8:41
Kharfax28-Jun-06 8:41 

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.