Subscribe to Subscribers

Online Members

Asheej T K
More...

Resources » Code Snippets » C# Syntax

Format currency according to a specific culture using NumberFormatInfo class


Posted Date:     Category: C# Syntax    
Author: Member Level: Gold    Points: 10



// used for formating currency to two decimal places
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;
//nfi.CurrencyDecimalDigits=2; // default is two, no need to set it up
nfi.NumberDecimalDigits = 2;
decimal amount=100M;
string amoutn = amount.ToString("N",nfi);





Did you like this resource? Share it with your friends and show your love!


Responses to "Format currency according to a specific culture using NumberFormatInfo class"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: change page title at run time
    Previous Resource: Using Delegate with Generic List to find an Item(s)
    Return to Resources
    Post New Resource
    Category: C# Syntax


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    (No tags found.)

    Awards & Gifts
    Talk to Webmaster Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2013 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.