I came on here and asked how to override the number formatting. Could
someone please answer my question, rather than argue about what's right and
what's wrong.
Thank you.
Context, please?
It is impossible to determine from the below what you are trying to do,
exactly.
But if it turns out that what you want to do is not a best practice and it
will not be good for the user of whatever you are developing, you should be
thanking the people who point it out....

Signature
MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap
This posting is provided "AS IS" with
no warranties, and confers no rights.
>I came on here and asked how to override the number formatting. Could
> someone please answer my question, rather than argue about what's right
> and
> what's wrong.
>
> Thank you.
Chris Mahoney - 17 Aug 2005 23:52 GMT
Sorry about the delay in replying.
> Context, please?
>
> It is impossible to determine from the below what you are trying to do,
> exactly.
Sorry, I have a bad habit of not including all the information :)
Simple line of VB code:
TextBox1.Text = String.Format("{0:c0}", 12345)
This results in the TextBox filling with "$12,345" when I want it to say
"$12 345".
> But if it turns out that what you want to do is not a best practice and it
> will not be good for the user of whatever you are developing, you should be
> thanking the people who point it out....
Look at any NZ Government publication (or many other NZ publications) and
you'll find a space as the separator.
Thanks
Chris
Michael (michka) Kaplan [MS] - 18 Aug 2005 15:46 GMT
You can update the numeric grouping separator in a CultureInfo's
NumberFormatInfo and then use that ci or nfi to do the formatting -- that is
the best way to proceed hee, given the code you are using (note the
String.Format override that uses an IFormatProvider -- you can pass the NFI
right there).

Signature
MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap
This posting is provided "AS IS" with
no warranties, and confers no rights.
> Sorry about the delay in replying.
>
[quoted text clipped - 22 lines]
> Thanks
> Chris
Chris Mahoney - 19 Aug 2005 00:25 GMT
Aha!
After all that trouble, I knew it'd be quite simple to do. Thanks!
Chris
On 19/8/05 2:46 AM, in article umZMoOApFHA.3544@TK2MSFTNGP15.phx.gbl,
> You can update the numeric grouping separator in a CultureInfo's
> NumberFormatInfo and then use that ci or nfi to do the formatting -- that is
> the best way to proceed hee, given the code you are using (note the
> String.Format override that uses an IFormatProvider -- you can pass the NFI
> right there).
> I came on here and asked how to override the number formatting. Could
> someone please answer my question, rather than argue about what's right and
> what's wrong.
In general I don't like teaching people how to shoot themselves (in the leg
or otherwise :-)

Signature
Mihai Nita [Microsoft MVP, Windows - SDK]
------------------------------------------
Replace _year_ with _ to get the real email