Sigh. I knew I''d get a reply like this. Yes, I have a good reason, two
of them in fact.
The data contains actual float values, but also string representations
of floats which use decimal points, not commas, and they need to stay
this way. So I need some consistency in my rows. (I have no control
over the data).
Furthermore, I have users in different countries who may not be
actually from that country, so a decision was made to use a consistent
"." notation whereever and whoever the user was.
A side benefit is that the locale of the SQL server uses this format
and it saves some mucking about, but I wouldn't have done this for just
that reason. I don't normally override user preferences or settings
arbitrarily.
I've disovered the solution is to fix a locale in web.config.
Damien wrote:
JDC wrote: Hi all,
Is there a recommended way (i.e. not a bodge) to get a GridView to
always display decimal numbers using a dot as the decimal separator,
regardless of the locale the user is viewing the page from? (I.e.
3.1415 not 3,1415)
Thanks in advance, Jeremy
Hi Jeremy,
I've seen a few messages like this in the past. Can you give me an idea
of why you would want to do this? So far as I can see, the user has
specified that it's more natural for them to view numbers using the
comma as the decimal separator, but you're deliberately wanting to
ignore that and force them to use a different convention?
Unless there's some particular narrow field of study within which
decimal dot is always used no matter where in the world someone is?
Damien