473,395 Members | 2,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.Globalization.CultureInfo.CurrentCulture()
obj.NumberFormat.CurrencySymbol = "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 10256
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.Globalization.CultureInfo.CurrentCulture()
obj.NumberFormat.CurrencySymbol = "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.NumberFormat) 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
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....
4
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
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...
0
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()...
4
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...
10
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...
18
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...
3
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...
3
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,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.