top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

VB.NET: How to remove decimal from currency datatype?

+2 votes
108 views

How to remove decimal from currency datatype?

posted Apr 16, 2014 by Khusboo

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+2 votes
 
Best answer

Try something like this

Console.WriteLine(value.ToString("C2"))        

where value is your variable and it will print the value two place after decimal. To get the value with no decimal try -

Console.WriteLine(value.ToString("C0"))        

Check the following links would be more helpful for you...
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx
http://msdn.microsoft.com/en-us/library/0c899ak8.aspx

answer Apr 17, 2014 by Salil Agrawal
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...