?
Solved

formatting currency

Posted on 2006-11-08
2
Medium Priority
?
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
Kinger247 earned 500 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

801 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