ParseNumber: Use InvariantCulture to avoid errors on double type number conversions

This commit is contained in:
2016-06-23 08:41:50 +02:00
parent 83b69e3f49
commit 35ec8b478f

View File

@@ -23,13 +23,6 @@ namespace VAR.PdfTools
public PdfParser(byte[] stream)
{
_stream = stream;
// Intentar usar el separador decimal de la cultura
try
{
_decimalSeparator = CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator;
}
catch { }
}
#endregion
@@ -436,7 +429,7 @@ namespace VAR.PdfTools
if (dotCount == 1)
{
PdfReal obj = new PdfReal();
obj.Value = Convert.ToDouble(sbNumber.ToString());
obj.Value = Convert.ToDouble(sbNumber.ToString(), CultureInfo.InvariantCulture);
return obj;
}
}