473,324 Members | 2,581 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,324 software developers and data experts.

How to get "$ ###,###,##0.00" from CultureInfo.NumberFormat

Hi,

I am able to create instance of Culture Info for different cultures. How
will I get number format as "$ ###,###,##0.00" from
CultureInfo.NumberFormat.

I need it in this format so that I can set format for a ultrawebgrid
column.(for eg. Me.uwgTest.Columns(15).Format=CultureInfo.NumberFo rmat)
Thanks,

Kiran
Nov 19 '05 #1
2 3817
kiran wrote:
Hi,

I am able to create instance of Culture Info for different cultures. How
will I get number format as "$ ###,###,##0.00" from
CultureInfo.NumberFormat.

I need it in this format so that I can set format for a ultrawebgrid
column.(for eg. Me.uwgTest.Columns(15).Format=CultureInfo.NumberFo rmat)
Thanks,

Kiran


Hi,

Use the NumberFormatInfo class ...

ex:
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;

if you need, you can specify custom things like currency symbol or
commas etc...

ex:
nfi.CurrencyDecimalDigits = 2;

--
Rob Schieber
Nov 19 '05 #2
Rob Schieber wrote:
kiran wrote:
Hi,

I am able to create instance of Culture Info for different cultures.
How will I get number format as "$ ###,###,##0.00" from
CultureInfo.NumberFormat.

I need it in this format so that I can set format for a ultrawebgrid
column.(for eg. Me.uwgTest.Columns(15).Format=CultureInfo.NumberFo rmat)
Thanks,

Kiran

Hi,

Use the NumberFormatInfo class ...

ex:
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;

if you need, you can specify custom things like currency symbol or
commas etc...

ex:
nfi.CurrencyDecimalDigits = 2;

Hi Rob,

Thanks for the reply

I was looking for a single step solution.

Looks like I have to generate "$ ###,###,##0.00" using properties and
functions of NumberFormat Class like CurrencyDecimalDigits,
CurrencySymbol etc....

Thanks
Kiran
Nov 19 '05 #3

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

Similar topics

4
by: Muscha | last post by:
Hello, I have a date string in the following format: "2003-10-29T17:44+00:00" When I put it to DateTime.Parse() method it throws an exception, how do I parse this date format? Thanks, /m
12
by: Emi Lu | last post by:
Hello all, I have a question about "date" & "timestamp" types in PostgreSQL. I want to setup the default value '0000-00-00' and "0000-00-00 00:00:00" for them. However, it seems that PostgreSQL...
5
by: ABC | last post by:
How to initial the datetime variable as value to "01/01/2005 00:00:00"?
2
by: Zach.Baier | last post by:
I have an document created with the XML writer that is having issues when loaded to a mainframe due to the fact the it is inserting a "." or "00" between each carachter when viewed as hex. Any...
7
by: Stimp | last post by:
I want to output a number, say 20, as 20.00 i.e. I want to always have 2 decimal places I don't want any currency information, therefore String.Format("{0:c}") doesn't work for me. Can't...
5
by: Bob | last post by:
Hello Folks, I am bring backa data reader dr from the database/ So I have a number of fields such as dr To put this in a table I use "<td>" + dr.ToString() + "</td>" But I want to...
0
by: Ronald S. Cook | last post by:
Stupid question for the day but weirdly I don't have this yet. How can I format a textbox such that if the user enters a number like 4 it will become (on validated) 4.00. If they enter 5.1 it...
3
by: Ronald S. Cook | last post by:
Stupid q for the day, but if the user enters 2 in a textbox, I want to display as 2.00. If they enter 2.129 I want it as 2.13. I'm guessing will code in the validated method of the textbox,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.