Handling different decimal separators

  • Thread starter Thread starter Jack Russell
  • Start date Start date
J

Jack Russell

Some countries use comma instead of point as the decimal separator (and
presumably there are other variations)

If one has a set of ascii files containing numbers stored in one culture
is there some standard method for reading them in another culture?

Thanks

Jack Russell
 
Jack Russell said:
Some countries use comma instead of point as the decimal separator (and
presumably there are other variations)

If one has a set of ascii files containing numbers stored in one culture
is there some standard method for reading them in another culture?

Yes, if you know which culture has been used to write the data to the file:

\\\
Imports System.Globalization
..
..
..
Dim nf As NumberFormatInfo = _
CultureInfo.CreateSpecificCulture("de-DE").NumberFormat
Dim i As Integer = Integer.Parse("2323,123", nf)
///
 
Thank you
Herfried said:
Yes, if you know which culture has been used to write the data to the file:

\\\
Imports System.Globalization
..
..
..
Dim nf As NumberFormatInfo = _
CultureInfo.CreateSpecificCulture("de-DE").NumberFormat
Dim i As Integer = Integer.Parse("2323,123", nf)
///
 
Back
Top