Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,928 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,848 people online right now. Registration is fast and FREE... Join Now!




How to display the euro symbol in VB.net?

 
Reply to this topicStart new topic

How to display the euro symbol in VB.net?

rjbzzr400
17 Dec, 2007 - 11:43 AM
Post #1

New D.I.C Head
*

Joined: 11 Dec, 2007
Posts: 15


My Contributions
Hi, how do I display the euro symbol in VB.net?
Thanks : >

txtTotalAssetsEuros.Text = totalAssetsEuros.ToString("?##,#00.00")
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: How To Display The Euro Symbol In VB.net?
17 Dec, 2007 - 12:02 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
You can use the ChrW() function, the euro symbol is unicode number 8364.

CODE

MessageBox.Show(ChrW(8364))


This is one way of showing the symbol in VB.NET. Give it a try. smile.gif

The other way will involve you changing the encoding through System.Text.Encoding. It can be a bit longer and tedious just to print one character. But if you are encoding whole strings, then you might want to choose that route. It is the official way of doing it through .NET.


This post has been edited by Martyr2: 17 Dec, 2007 - 12:15 PM
User is offlineProfile CardPM
+Quote Post

rjbzzr400
RE: How To Display The Euro Symbol In VB.net?
18 Dec, 2007 - 04:49 AM
Post #3

New D.I.C Head
*

Joined: 11 Dec, 2007
Posts: 15


My Contributions
Hi thanks for you reply :>, sorry I didn't mention that I need to use the symbol in
this piece of code where the ? is.

CODE

txtTotalAssetsEuros.Text = totalAssetsEuros.ToString("?##,#00.00")


I tried sticking ChrW(8364) in but it just reads it as a string : <




User is offlineProfile CardPM
+Quote Post

orcasquall
RE: How To Display The Euro Symbol In VB.net?
18 Dec, 2007 - 08:02 AM
Post #4

D.I.C Head
Group Icon

Joined: 14 Sep, 2007
Posts: 158



Thanked: 3 times
Dream Kudos: 50
My Contributions
Have you tried simply typing in the Euro sign? Like so
CODE

txtTotalAssetsEuros.Text = totalAssetsEuros.ToString("€##,#00.00")

Just hold the Alt key, then type 0, 1, 2, 8 (in that order from your numeric keypad. The number keys above your alphabet keys don't work), then let go of the Alt key.

Or you can use the Character Map, available through [Start] menu, [All Programs], [Accessories], [System Tools].

Or you can adapt Martyr2's advice into this
CODE

txtTotalAssetsEuros.Text = ChrW(8364) + totalAssetsEuros.ToString("##,#00.00")

Simply leave out the Euro sign from the ToString format descriptor.
User is offlineProfile CardPM
+Quote Post

rjbzzr400
RE: How To Display The Euro Symbol In VB.net?
18 Dec, 2007 - 12:49 PM
Post #5

New D.I.C Head
*

Joined: 11 Dec, 2007
Posts: 15


My Contributions
Yay done. Thanks : > I discovered the Alt method years ago but forgot about it lol
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: How To Display The Euro Symbol In VB.net?
18 Dec, 2007 - 12:52 PM
Post #6

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Just be careful with that method. It may not work in all situations and can also limit design possibilities in the future. smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 03:08PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month