Decimal Point
-
Hi there, The user input a decimal number 123.456, how do i work on the number behind the decimal point.
-
Hi there, The user input a decimal number 123.456, how do i work on the number behind the decimal point.
Hi, integer numbers can't handle the fractional part. Floating-point numbers can; that is their purpsoe. Look for the Single and Double data types, and the corresponding classes. Double.TryParse() may suit your needs. If this is new to you, I strongly recommend you buy an introductory book on VB.NET and work your way through it. :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
-
Hi, integer numbers can't handle the fractional part. Floating-point numbers can; that is their purpsoe. Look for the Single and Double data types, and the corresponding classes. Double.TryParse() may suit your needs. If this is new to you, I strongly recommend you buy an introductory book on VB.NET and work your way through it. :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
Luc Pattyn wrote:
ForumVisual Basic / VB.NET Subject:Re: Decimal Point Sender:Luc Pattyn Date:6:13 5 Aug '07 Hi, integer numbers can't handle the fractional part. Floating-point numbers can; that is their purpsoe. Look for the Single and Double data types, and the corresponding classes. Double.TryParse() may suit your needs. If this is new to you, I strongly recommend you buy an introductory book on VB.NET and work your way through it. Luc Pattyn
Integer numbers can't handle fractions, WELL DUH....Anyone knows that:mad::mad: Everyone needs a little help, now and then, even people like you.........
-
Luc Pattyn wrote:
ForumVisual Basic / VB.NET Subject:Re: Decimal Point Sender:Luc Pattyn Date:6:13 5 Aug '07 Hi, integer numbers can't handle the fractional part. Floating-point numbers can; that is their purpsoe. Look for the Single and Double data types, and the corresponding classes. Double.TryParse() may suit your needs. If this is new to you, I strongly recommend you buy an introductory book on VB.NET and work your way through it. Luc Pattyn
Integer numbers can't handle fractions, WELL DUH....Anyone knows that:mad::mad: Everyone needs a little help, now and then, even people like you.........
Yeah, I need help in guessing which elementary things you know and don't know. The integer part of a floating-point number is available by ... to ..., or by using the ... method, and the fractional part is what is left when you subtract the integer part from it. But of course you knew all that. Now what is the question ? :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google