Solved

formatting currency

Posted on 2006-11-08
2
188 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

13 Experts available now in Live!

Get 1:1 Help Now