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

K

kiran

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.NumberFormat)


Thanks,

Kiran
 
R

Rob Schieber

kiran said:
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.NumberFormat)


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;
 
K

kiran

Rob said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top