|
|
|
|
![]() ![]() |
Apr 8 2008, 05:14 AM
Post
#11
|
|
|
Premium Member Group: [HOSTED] Posts: 415 Joined: 16-February 06 From: Kolkata, India Member No.: 11,322 myCENTs:67.18 |
Your method seems excessive, why not just retrieve the value and then truncate it. While it probably doesn't matter for the scope of his problem, using loops while going through massive data can be taxing on resources. Granted the first explanation wasn't very good, but if you look up the truncate function in the Microsoft C# reference library it will explain how to use it, I'm sure it will fit your needs. @Sandip is there a reason you can't truncate the value? If so please post it and I'll give you some more feedback. I did not get what you mean to say by using the Truncate method. The Decimal.Truncate() method returns the nearest whole number. While the given problem has got nothing to do with points. Am I missing out on something or are you confusing the two feedbacks? I have answered to malleswararao's problem of determining the sum of digits at even and odd positions in a given number. |
|
|
|
Apr 8 2008, 02:16 PM
Post
#12
|
|
|
Newbie [ Level 2 ] Group: [HOSTED] Posts: 18 Joined: 22-March 08 Member No.: 29,297 |
are you confusing the two feedbacks? This is absolutely the case. Sorry, I was answering the question directly above your post, figured you were doing the same as well seeing as how the post you responded to was from February 23rd, 2008. The guy who wanted to make 4 decimal points into two (Sandip, was his name-o) you need to multiply the number out so that those two decimal points are part of the whole number, then truncate the value, then divide by the amount you multiplied by, and you have your two digits instead of 4. |
|
|
|
May 20 2008, 05:43 AM
Post
#13
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
Rounding of double upto two digits
Decrementing Number Of Digits Ofter Point Replying to miCRoSCoPiC^eaRthLinG Thanks, only you need to replace int to double and remaining works fine... -reply by Sunil Rajak |
|
|
|
Jun 10 2008, 06:39 AM
Post
#14
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
what is \\\" N2 \\\" here give some details of it to use in proper manner.
Decrementing Number Of Digits Ofter Point What is " N2 " here give some details of it to use in proper manner. -reply by yashwant |
|
|
|
Jun 25 2008, 06:54 AM
Post
#15
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
Ur suggestion helps me out
Decrementing Number Of Digits Ofter Point Replying to miCRoSCoPiC^eaRthLinG I read your reply and it helped me in solving my problem when I use N3 it is giving me the accurate values.I didn't test it for the -ve values -reply by Ankit khanna |
|
|
|
Jul 14 2008, 10:02 AM
Post
#16
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
How to check the ODD or Even Number??
Decrementing Number Of Digits Ofter Point Let me know how will I check the the given number is odd or Even numbers? Can you Help me! Give me a logic -question by Ramesh |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 5th December 2008 - 05:01 PM |