473,769 Members | 5,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change currency symbol

Hi All,

I want to change currency symbol of current culture.
I am trying to do this by following code.
Dim obj As CultureInfo = System.Globaliz ation.CultureIn fo.CurrentCultu re()
obj.NumberForma t.CurrencySymbo l = "Rs"

Session.LCID = obj.LCID
But, still all currency controls on page shows "$"
So how to achieve this?
Since, we can read and write "CurrencySymbol " property then why it's not
working?
Any suggestion please?

Thanks in advance.

Sakharam Phapale
Nov 16 '05 #1
1 10319
Sakharam Phapale wrote:
Hi All,

I want to change currency symbol of current culture.
I am trying to do this by following code.
Dim obj As CultureInfo =
System.Globaliz ation.CultureIn fo.CurrentCultu re()
obj.NumberForma t.CurrencySymbo l = "Rs"

Session.LCID = obj.LCID
But, still all currency controls on page shows "$"
So how to achieve this?
Since, we can read and write "CurrencySymbol " property then why it's
not working?
Any suggestion please?

Thanks in advance.

Sakharam Phapale


Hi Sakharam,

It does in fact work, just not the way that you are expecting, you can
alter the currency symbol, but it is only altered for that instance of
the CultureInfo object. i.e. if you were to do something like
value.ToString( "C",obj.NumberF ormat) you would get the expected result
however this is not much good to you when you are passing to another
control or routine that is doing the formatting.

If you need to persist the change to the system so that each time you
get a CurrentCulture its the changed value, you will need to PInvoke to
the SetLocaleInfo API call with the LOCAL_SCURRENCY flag set.

Regards Tim.
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2980
by: J P Singh | last post by:
Hi Guys I am trying to store the currency symbol used for a trasaction in a database field but rather than store £ it stores £ (see the wierd character at the beginning of the symbol) instead. The strange thing in even after storing this when I display the currency on one page it shoes it as £ but on two of the pages it still shows £ I have looked at the database the value stored is £ where as the user is
4
22597
by: Gerry Abbott | last post by:
Hi All. How can i put a zero decimal for my currency into my format statement, == & ", for " & & " days. Cost " & Format(,"Currency") which is the data source for a textbox on a report
2
5692
by: zlf | last post by:
Hi, Run this code will cause format exception. I think the problem is induced by using System.Globalization.NumberStyles.Currency since I used customed currency symbol("My Dollar:"). Please tell me how to modify this block of code.Thanks Console.WriteLine ( NumberValue.ToString ( formatString , n ) ); NumberFormatInfo numberFormatInfo = new System.Globalization.NumberFormatInfo();
0
1390
by: Sakharam Phapale | last post by:
Hi All, I want to change currency symbol of current culture. I am trying to do this by following code. Dim obj As CultureInfo = System.Globalization.CultureInfo.CurrentCulture() obj.NumberFormat.CurrencySymbol = "Rs" Session.LCID = obj.LCID
4
2029
by: Mitchell Vincent | last post by:
How is everyone formatting currency with VB.NET? Before I was calling the API function for it, which took the currency symbol from the Windows settings. I've found this to be limited when working with European countries where business in conducted in several different currencies. Are you guys just storing a currency symbol and formatting the number accordingly? What about the comma and decimal switch that some locales use? I hope .NET...
10
10204
by: Mike9900 | last post by:
Hello, I need a regular expression to match a currency with its symbol, for example Pound66.99 must return 66.99 or Pound(66.99) or Pound-66.99 or -66.99Pound return -66.99 or any other combination return the decimal number. I have created a regular expression, but it seems that it does not work if the number is Pound66.99 but it works if the sign is after the number: public static Decimal ConvertToDecimal(String str)
18
6192
by: Boris Yeltsin | last post by:
OK, I have a database table, it has prices of products in it, like so: ProductPrice MONEY ProductIsoCurrencyCode CHAR(3) Now, both CultureInfo and RegionInfo have currency-handling functions inside them, but I want to display the price on my web site given the information above, plus the current culture of the web site visitor. So, I have
3
3370
by: pb | last post by:
If I have a currency code like "USD" or "EUR", how do I format a string from a decimal value that would contain the correct currency symbol? for example, if I have "USD" and 345.45, I want to see "$345.45", but if I have "GBP" and 345.45 I want to see "345.45 ". I can see how you can start with a culture like en-US and get the output, but I am starting only from a currency code. thanks.
3
7334
by: Eric | last post by:
I know this is a property of the RegionInfo class. I figure somewhere in the framework is the actual enumeration, which I would like to use. I want to use it to support a Money class I need, along the lines of Fowler, which would have an attribute of Currency. Any help much appreciated.
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.