C# Windows Form Globalization format problem

  • Thread starter Thread starter Jason Huang
  • Start date Start date
J

Jason Huang

Hi,

I have a TextBox txtNumber which uses the CultureInfo( "en-US",
false ).NumberFormat,
so the txtNumber looks like "1,234,567.00".
Now my problem is how do I retrieve the value of the txtNumber so it will be
"1234567" and not "1,234,567.00".
Thanks for help.


Jason
 
Jason said:
I have a TextBox txtNumber which uses the CultureInfo( "en-US",
false ).NumberFormat,
so the txtNumber looks like "1,234,567.00".
Now my problem is how do I retrieve the value of the txtNumber so it will be
"1234567" and not "1,234,567.00".

I'm not entirely sure I understand exactly where the problem is. Do you
have an int (or double, or decimal) and want to convert to a string
without the thousands separator, or do you have a string and wish to
parse it to an int/double/decimal/etc, or do you have a string and wish
to convert it to another string?

Could you produce a short but complete program which demonstrates the
problem?

Jon
 
Back
Top