Solved

formatting currency

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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