top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

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

+2 votes
369 views

How to remove decimal from currency datatype?

posted Apr 16, 2014 by Khusboo

Share this question
Facebook Share Button Twitter Share Button LinkedIn 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
...