Hi All,
I have a decimal value on the GridView BoundField which comes from sql
server and it seems on gridview like that;
2096.62
14899.01
I want to display that values like
2.096,62
14.899,01
Thanks for any help 8 1563
"Nariban Barkan" <So**********@s.comwrote in message
news:e9**************@TK2MSFTNGP06.phx.gbl...
I have a decimal value on the GridView BoundField which comes from sql
server and it seems on gridview like that;
2096.62
14899.01
I want to display that values like
2.096,62
14.899,01
<asp:BoundField DataField="MyField" DataFormatString="{0:#.##0,00}"
HtmlEncode="false" HeaderText="MyField" />
--
Mark Rae
ASP.NET MVP http://www.markrae.net
On Jun 9, 11:50 am, "Nariban Barkan" <SomeFunny...@s.comwrote:
Hi All,
I have a decimal value on the GridView BoundField which comes from sql
server and it seems on gridview like that;
2096.62
14899.01
I want to display that values like
2.096,62
14.899,01
Thanks for any help
If you want to use locale-dependent group separator and decimal point,
then you need the "N" format specifier.
I have a decimal value on the GridView BoundField which comes from sql
server and it seems on gridview like that;
2096.62
14899.01
I want to display that values like
2.096,62
14.899,01
Convert to a double with Parse (or TryParse), then use ToString("N")
(or ToString("N",culture) if you want a culture other than the current one)
--
Mihai Nita [Microsoft MVP, Visual C++] http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Thanks all..
and can i add a special tag or a custom currency mark after or before the
value on the BoundField column ?
On Jun 9, 4:50*am, "Nariban Barkan" <SomeFunny...@s.comwrote:
Thanks all..
and can i add a special tag or a custom currency mark after or before the
value on the BoundField column ?
...or you can do format it in your sql server procedure... --for
example see : http://www.siccolo.com/Articles/SQLS...-currency.html
I know that not everyone is fond of formatting on sql server side, but
it's just a suggestion...
... more at http://www.siccolo.com/articles.asp
On Jun 9, 12:50 pm, "Nariban Barkan" <SomeFunny...@s.comwrote:
Thanks all..
and can i add a special tag or a custom currency mark after or before the
value on the BoundField column ?
Then you need custom number format such as "#,##0.00'tag'" (note the
single quotes around 'tag' - they will ensure it is treated as a
literal string).
That's for CellFormatting event, though. For CellParsing, which you'll
also need for full two-way data binding, you'll probably want to trim
the tag/mark with String.Substring first, and then run it through
Decimal.Parse.
In general, I'd recommend searching MSDN for "Custom Numeric Format
Strings". It has more detailed explanations of what you can do with
this, and how.
Then you need custom number format such as "#,##0.00'tag'" (note the
single quotes around 'tag' - they will ensure it is treated as a
literal string).
Proper locale-aware formatting is done by setting
NumberFormatInfo.CurrencySymbol and using ToString("C", ...)
A currency format is not just a number format with currency attached to it
(even in US -123 migh be represented as (123) when it's about financial
stuff)
--
Mihai Nita [Microsoft MVP, Visual C++] http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
On Jun 11, 10:18 am, "Mihai N." <nmihai_year_2...@yahoo.comwrote:
Then you need custom number format such as "#,##0.00'tag'" (note the
single quotes around 'tag' - they will ensure it is treated as a
literal string).
Proper locale-aware formatting is done by setting
NumberFormatInfo.CurrencySymbol and using ToString("C", ...)
A currency format is not just a number format with currency attached to it
(even in US -123 migh be represented as (123) when it's about financial
stuff)
--
Mihai Nita [Microsoft MVP, Visual C++]http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
That's assuming the original question was about locale-specific
currency formatting. However, the request was about "special tag or a
custom currency mark" - which, as I understand it, assumes that it is
not locale-dependent (and, indeed, may not be a currency sign at all,
merely something similar). This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: stevek |
last post by:
How do I format an integer. Add commas.
1234565 1,234,565
TIA
|
by: Nick |
last post by:
Well, the project I am working on has now come to a screeching halt! I
have been developing a program that heavily utilizes ADO.NET record
sets. To generate reports, I convert the recordset to XML,...
|
by: Mike MacSween |
last post by:
This looks like a bug to me.
I have an expression on a report:
=Format(Sum((**)*(/)),"0.00")
Score is byte
PercentOfGrade is double
PropDegree is single
ModuleCats is byte
|
by: Terencetrent |
last post by:
I am trying to format a query expression drawn from a dialog box as
percent.
The original statement to get the value for the query is as follows:
New%markup: !!
The dialog box looks the...
|
by: Hers2keep |
last post by:
I have the following control on a report:
"Total " & & " " & & " -- " &
Format$(Sum(),"Standard")
I can't use the simple way because of the concatenated fields. How can
I force no decimal...
| |
by: Sick |
last post by:
My application populates a ListBox from a .TXT file. In the textfile there
are prices with both dots as well as comma's for decimal indication.
Example:
1234990; xg-tr-45; 1700,50; 0
2662666;...
|
by: Robin Tucker |
last post by:
My database has a column for numeric data items. How can I use
this number in the "format" command, such that for, say precision 2, I get
numbers like 2011.01 or 2387.00 and for 4 I would get...
|
by: AMDRIT |
last post by:
Hello Everyone,
I would like to format the Display Members of a combobox's datasource. Is
there a way to apply a format without subclassing the original datasource?
For example, given a list of...
|
by: RipperT |
last post by:
Don't know if this group covers web apps, but here goes. In VS 2005, I am
trying to get variables to hold thier values during postback from the
server. I convert a text box's user-keyed value to an...
|
by: hunslair |
last post by:
This is a really basic question. I am taking a teach yourself
beginners course on Access 2003 and have run into a road block on one
practice. In a select query, I have created a simple calculation...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |