473,387 Members | 3,033 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,387 software developers and data experts.

NumberFormatInfo

Hi,

I am using the following lines of code to format a number according to a
culture:

//Get the number format according to the user culture.
NumberFormatInfo nfi = new CultureInfo( cultureInfo.Name ,
false ).NumberFormat;

//Format the number to 2 decimal places.
nfi.NumberDecimalDigits = 2;

//Return the price, according to the numberformat.
return dPrice.ToString("N",nfi) ;

The idea behind it is that the price is 150 the output is 150.00 or 150,00
according to the culture.

This works fine, but when the user selects the spanish culture, the result
is 150000.00. Can someone tell me what i am doing wrong?

Thanks
Nov 17 '05 #1
0 4513

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

Similar topics

0
by: Dennis Myrén | last post by:
Hi. I use a System.Globalization.NumberFormatInfo (a System.IFormatProvider derival) instance for formatting numbers. I want to use the NumberDecimalDigits member property to round the numbers...
8
by: Max | last post by:
My client has decided to use the Euro for the entire web site. Is there an easy way to get my ASP.NET app to format currency to Euro instead of US-dollar? Right now it's just reading the server...
6
by: Woody Splawn | last post by:
We have access to Infragistics etc., but we would like to make use of a regular VS textbox so that it accepts only numbers. We have discovered that if you bind an integer field to a textbox, for...
1
by: Dave Wurtz | last post by:
All, I have a NumberFormatInfo object with specific setting (i.e. number of decimals, thousands separator, decimal separator, currency symbols, etc.) based upon my application, not my system's...
1
by: Mythran | last post by:
The NumberDecimalPlaces property is messing me up. I have an arbitrary number, lets say 1234.567. What do I need to do to get the following string: $1 , 234.567...or any decimal value? ...
7
by: kingski | last post by:
Any idea about this ? http://www.developerfusion.co.uk/forums/thread/114379/#114379 "Can any one help me as i am building a shopping cart and it supports multiple currencies but while sending...
0
by: Billy | last post by:
Why do I still have to provide a 'String Format' when I have created a NumberFormatInfo object (nfi) that should display what I need. For example I have created a default NumberFormatInfo now when...
8
by: WhiteWizard | last post by:
Have we got a STRANGE one going here. We converted from 1.1 to 2.0 about 2 weeks ago and this has been a problem since then...but only on SOME machines in our development group. The application...
0
by: schaf | last post by:
Hi NG! I have a really suspect problem! Irun the following code on a Windows XP Professional SP2 and every thing works fine: System.Globalization.NumberFormatInfo numberFormatInfo =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...

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.