Solved

formatting currency

Posted on 2006-11-08
2
189 Views
Last Modified: 2010-04-23
Hi

How do i format a decimal value as a uk currency with 2 decimal places and a £ sign

thanks
andrea
0
Comment
Question by:andieje
2 Comments
 
LVL 10

Accepted Solution

by:
Kinger247 earned 125 total points
ID: 17897567
andieje try:

        Dim Price As Decimal = 9.99
        Dim s As String = String.Format("{0:c}", price)
        Console.WriteLine(s)
0
 
LVL 17

Assisted Solution

by:ZeonFlash
ZeonFlash earned 125 total points
ID: 17897844
Here's how to get the '£' sign using CultureInfo:

            Dim objCulture As New System.Globalization.CultureInfo("en-GB", False)
            Dim myVal As Decimal = 2.4

            MessageBox.Show(myVal.ToString("c", objCulture))  'Result will be:  £2.40
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Change data in datatable 8 30
Close tabpage of custom control 9 23
Get Top Visible Row of Datagridview 6 27
C# Single Form 8 27
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now