Hi,
I am trying to display a currency value formated according to the current
culture in ASP.NET:
decimal x = 125345.54M;
string currencyString = String.Format("{0:c}",x);
what gets retured is 125,345.54 without the currency symbol of $
I checked and re-checked my regional settings and tried it on other PCs
without success...
When I put a breakpoint and view the following in the Immediate window I see
that the AnsiCurrencySymbol is null and the CurrencySymbol is "" for some
reason:
System.Threading.Thread.CurrentThread.CurrentCultu re.NumberFormat
{System.Globalization.NumberFormatInfo}
System.Object: {System.Globalization.NumberFormatInfo}
ansiCurrencySymbol: null
AnsiCurrencySymbol: null
CurrencyDecimalDigits: 2
currencyDecimalDigits: 2
CurrencyDecimalSeparator: "."
currencyDecimalSeparator: "."
currencyGroupSeparator: ","
CurrencyGroupSeparator: ","
CurrencyGroupSizes: {Length=1}
currencyGroupSizes: {Length=1}
CurrencyNegativePattern: 0
currencyNegativePattern: 0
CurrencyPositivePattern: 0
currencyPositivePattern: 0
CurrencySymbol: ""
currencySymbol: ""
CurrentInfo: {System.Globalization.NumberFormatInfo}
InvariantInfo: {System.Globalization.NumberFormatInfo}
invariantInfo: {System.Globalization.NumberFormatInfo}
IsReadOnly: false
isReadOnly: false
m_dataItem: 41
m_useUserOverride: true
NaNSymbol: "NaN"
nanSymbol: "NaN"
negativeInfinitySymbol: "-Infinity"
NegativeInfinitySymbol: "-Infinity"
NegativeSign: "-"
negativeSign: "-"
NumberDecimalDigits: 2
numberDecimalDigits: 2
NumberDecimalSeparator: "."
numberDecimalSeparator: "."
NumberGroupSeparator: ","
numberGroupSeparator: ","
NumberGroupSizes: {Length=1}
numberGroupSizes: {Length=1}
numberNegativePattern: 1
NumberNegativePattern: 1
PercentDecimalDigits: 2
percentDecimalDigits: 2
percentDecimalSeparator: "."
PercentDecimalSeparator: "."
PercentGroupSeparator: ","
percentGroupSeparator: ","
percentGroupSizes: {Length=1}
PercentGroupSizes: {Length=1}
PercentNegativePattern: 0
percentNegativePattern: 0
percentPositivePattern: 0
PercentPositivePattern: 0
percentSymbol: "%"
PercentSymbol: "%"
PerMilleSymbol: "?"
perMilleSymbol: "?"
PositiveInfinitySymbol: "Infinity"
positiveInfinitySymbol: "Infinity"
positiveSign: "+"
PositiveSign: "+"
validForParseAsCurrency: true
validForParseAsNumber: true
I thought that the CurrentCultureInfo takes its information from the
regional settings of the PC...
Please help!
Thanks,
Vlad 2 3608
Please disregard...
"Vlad" <RE***************@comcast.net> wrote in message
news:#t**************@TK2MSFTNGP11.phx.gbl... Hi,
I am trying to display a currency value formated according to the current culture in ASP.NET: decimal x = 125345.54M; string currencyString = String.Format("{0:c}",x); what gets retured is 125,345.54 without the currency symbol of $
I checked and re-checked my regional settings and tried it on other PCs without success...
When I put a breakpoint and view the following in the Immediate window I
see that the AnsiCurrencySymbol is null and the CurrencySymbol is "" for some reason: System.Threading.Thread.CurrentThread.CurrentCultu re.NumberFormat
{System.Globalization.NumberFormatInfo}
System.Object: {System.Globalization.NumberFormatInfo} ansiCurrencySymbol: null AnsiCurrencySymbol: null CurrencyDecimalDigits: 2 currencyDecimalDigits: 2 CurrencyDecimalSeparator: "." currencyDecimalSeparator: "." currencyGroupSeparator: "," CurrencyGroupSeparator: "," CurrencyGroupSizes: {Length=1} currencyGroupSizes: {Length=1} CurrencyNegativePattern: 0 currencyNegativePattern: 0 CurrencyPositivePattern: 0 currencyPositivePattern: 0 CurrencySymbol: "" currencySymbol: "" CurrentInfo: {System.Globalization.NumberFormatInfo} InvariantInfo: {System.Globalization.NumberFormatInfo} invariantInfo: {System.Globalization.NumberFormatInfo} IsReadOnly: false isReadOnly: false m_dataItem: 41 m_useUserOverride: true NaNSymbol: "NaN" nanSymbol: "NaN" negativeInfinitySymbol: "-Infinity" NegativeInfinitySymbol: "-Infinity" NegativeSign: "-" negativeSign: "-" NumberDecimalDigits: 2 numberDecimalDigits: 2 NumberDecimalSeparator: "." numberDecimalSeparator: "." NumberGroupSeparator: "," numberGroupSeparator: "," NumberGroupSizes: {Length=1} numberGroupSizes: {Length=1} numberNegativePattern: 1 NumberNegativePattern: 1 PercentDecimalDigits: 2 percentDecimalDigits: 2 percentDecimalSeparator: "." PercentDecimalSeparator: "." PercentGroupSeparator: "," percentGroupSeparator: "," percentGroupSizes: {Length=1} PercentGroupSizes: {Length=1} PercentNegativePattern: 0 percentNegativePattern: 0 percentPositivePattern: 0 PercentPositivePattern: 0 percentSymbol: "%" PercentSymbol: "%" PerMilleSymbol: "?" perMilleSymbol: "?" PositiveInfinitySymbol: "Infinity" positiveInfinitySymbol: "Infinity" positiveSign: "+" PositiveSign: "+" validForParseAsCurrency: true validForParseAsNumber: true
I thought that the CurrentCultureInfo takes its information from the regional settings of the PC...
Please help!
Thanks,
Vlad
Hi Vlad,
I'm viewing the post and find it is a duplicated one with another in the
Newsgroups: microsoft.public.dotnet.framework.aspnet group,
I've posted my reply and provided my suggestion there. Would you have a
look.
Also, if you still have any question, please feel free to post there.
Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey http://msdn.microsoft.com/asp.net/whidbey/default.aspx This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Hung Huynh |
last post by:
Is there an easy way to change Currency formatting from USD to EUR (use
comma as decimals delimiter instead of period)?
I'm using Windows 2000 Server/IIS 5.0 in English. I'm serving both USD and...
|
by: Dalan |
last post by:
This should not be an issue, but it is. I'm sure that someone knows
what little piece of code is needed too persuade Access 97 to include
a currency format for labels (Avery, mailing type). Have...
|
by: Melissa |
last post by:
I have several fields in my database specified as Currency data type. Is there a
way globally to set these fields not to display the dollar sign?
Thanks!
Melissa
|
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
|
by: Tom Keane |
last post by:
Hi, I need some helpings again!
I have a query from one of my tables that gets a total amount of money and
gets a percentage from it
ie, the field I create in the query is invGSTAmount from a...
| |
by: Vlad |
last post by:
Hi,
I am trying to display a currency value formated according to the current
culture in ASP.NET:
decimal x = 125345.54M;
string currencyString = String.Format("{0:c}",x);
what gets retured is...
|
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...
|
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...
|
by: Scott M. |
last post by:
Ok, this is driving me nuts...
I am using VS.NET 2003 and trying to take an item out of a row in a
loosely-typed dataset and place it in a label as a currency. As it is now,
I am getting my...
|
by: maxpirate |
last post by:
The currency values are displayed in format of the regional settings specified in the computer of the user. I would like to display all the currency values in dollar format irrespective of the...
|
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,...
| |
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...
|
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,...
|
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...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 ...
|
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...
| |