Subscribe to Subscribers
Talk to Webmaster Tony John

Online Members

More...


Forums » .NET » .NET »

Convert decimal number into whole number in vb.net


Posted Date: 17 Jun 2012      Posted By:: Siva Shankar     Member Level: Silver    Member Rank: 1483     Points: 1   Responses: 2



I want to convert the decimal number into whole number in vb.net.That means i am having 78.9 i want to convert this into 78 or 79 in vb.net




Responses

#675927    Author: Ravindra Gaurana      Member Level: Gold      Member Rank: 179     Date: 17/Jun/2012   Rating: 2 out of 52 out of 5     Points: 1

Hi Shiva,


You can use here Math.Round()

Regards,
Ravindra

Thanks & Regards
Ravindra Gaurana
Dotnetravindera@gmail.com
Catch Me dotnetspider



 
#677132    Author: Ultimaterengan        Member Level: Gold      Member Rank: 9     Date: 24/Jun/2012   Rating: 2 out of 52 out of 5     Points: 2


'To get without round up
Dim d As Decimal = 78.9
Dim i As Integer = Convert.ToInt32(d)

'this code will give with round up
Dim d1 As Decimal = 78.9

Dim j As Integer = Math.Round(d1)




Thanks & Regards
G.Renganathan
Nothing is mine ,Everything is yours!!!


http://renganathan1984.blogspot.com/



 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : Getting Particular Date Data from Sql Server
Previous : Convert decimal number into whole number in vb.net
Return to Discussion Forum
Post New Message
Category:

Related Messages



Follow us on Twitter: https://twitter.com/dotnetspider

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.