Welcome Guest ( Log In | Register )



2 Pages V  < 1 2  
Reply to this topicStart new topic
> Decrementing Number Of Digits Ofter Point, In C#
turbopowerdmaxst...
post Apr 8 2008, 05:14 AM
Post #11


Premium Member
Group Icon

Group: [HOSTED]
Posts: 371
Joined: 16-February 06
From: Kolkata, India
Member No.: 11,322



QUOTE(Doc.h0llyw00d @ Apr 7 2008, 11:22 PM) *
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.
Go to the top of the page
 
+Quote Post
Doc.h0llyw00d
post Apr 8 2008, 02:16 PM
Post #12


Newbie [ Level 2 ]
Group Icon

Group: [HOSTED]
Posts: 18
Joined: 22-March 08
Member No.: 29,297



QUOTE(turbopowerdmaxsteel @ Apr 8 2008, 01:14 AM) *
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.
Go to the top of the page
 
+Quote Post
iGuest
post May 20 2008, 05:43 AM
Post #13


Newbie [ Level 1 ]
Group Icon

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
Go to the top of the page
 
+Quote Post
iGuest
post Jun 10 2008, 06:39 AM
Post #14


Newbie [ Level 1 ]
Group Icon

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
Go to the top of the page
 
+Quote Post
iGuest
post Jun 25 2008, 06:54 AM
Post #15


Newbie [ Level 1 ]
Group Icon

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
Go to the top of the page
 
+Quote Post
iGuest
post Jul 14 2008, 10:02 AM
Post #16


Newbie [ Level 1 ]
Group Icon

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
Go to the top of the page
 
+Quote Post

2 Pages V  < 1 2
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. What Is: World's Largest Known Prime Number(20)
  2. WAP54G Linksys Wireless Access Point(7)
  3. How Can I Create A "number Of Visitors" Script(8)
  4. Neopets News(14)
  5. A Small Project: Splitting An Integer Into Digits(5)
  6. Finding The Current Line Number In A Text Box(1)
  7. Fibonacci Number Program Problem(5)
  8. Can I Please Have The 30 Point Hosting Pack ?(1)
  9. Interested In Acquiring Webspace(2)
  10. Prime Number Generator(1)
  11. Hinduism - The Breeder Of World Religions?(23)
  12. Domain Name Parking(8)
  13. Get The Most From Your Post(20)
  14. Visitor Hit Counter Script?(7)
  15. Count The Number Of Records Of A Table Group By A Foreign Key(0)
  1. Help Me To Edit Mx Records To Point To Google Apps(5)
  2. Yeppee ! Post Number One Thousand !(5)
  3. Reliable Hardware Serial Number For Software Protection?(10)
  4. My Xbox 360 Vs. Ps3 Vs. Wii Review(3)
  5. The Sum Of The Cubes Of The Digits Of Any Non-negative Integer(5)
  6. Auto-number Help In Access Db & Vb .net(6)
  7. Hints Point That Dell Will Be Pre-installing Ubuntu Soon!(22)
  8. Cracking Wireless Access Point Password?(22)
  9. How To Limit The Number Of Pages In Ms Word?(6)
  10. Necklace Problem(8)
  11. Maximum Number Of Decimal Places In Perl Language(0)
  12. What Is The Best Way To Merge An Unknown Number Of Arrays?(4)
  13. Mysql Question(inserting Number From A Textfield)(3)


 



- Lo-Fi Version Time is now: 5th September 2008 - 07:43 AM