Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Wiki Markup
{introducedin: 8.4

...

Description

Excerpt

Sets or returns whether to convert numeric strings such as currencies and formatted numerals in the imported data to numbers by using the culture information specified through the ConversionCulture property. By default it is set to false.



{remarks}

{example}
{code:csharp|title=C#}

    DataImportProperties importProps = wb.CreateDataImportProperties();

    //--- Get ConvertStrings
    bool convertStrings = importProps.ConvertStrings;

    //--- Set ConvertStrings
    importProps.ConvertStrings = true;

{code}
{code:vb.net
|title=vb.net
}

    Dim importProps As DataImportProperties = wb.CreateDataImportProperties()

    '--- Get ConvertStrings
    Dim convertStrings As Boolean =  importProps.ConvertStrings

    '--- Set ConvertStrings
    importProps.ConvertStrings = True

Signature
C#C#
}{description}

{excerpt}
Sets or returns whether to convert numeric strings such as currencies and formatted numerals in the imported data to numbers by using the culture information specified through the [ConversionCulture|DataImportProperties.ConversionCulture] property. By default it is set to {{false}}.
{excerpt}

{signature:C#}
public boolean ConvertStrings{ get; set; }
Signature
{signature}
{signature:vb.net
vb.net
}
Public Property ConvertStrings() As Boolean
Remarks
By
{signature}

{remarks}
By default, when importing data, ExcelWriter will not convert numeric strings to numbers. If {{ConvertStrings}} is set to {{true}}, ExcelWriter will parse the strings into a {{decimal}} type by using the culture information specified through the [ConversionCulture|DataImportProperties.ConversionCulture] property. If no specific culture is explicitly set, the invariant culture will be used to parse the numeric string. Currently only the currencies and formatted numerals (such as numbers with the decimal and thousands delimiters) will be parsed into numbers. Percentage, date and time, exponents and hexadecimal representations won't be converted.
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle
Remarks
When ConvertStrings is set to true it will also affect column names when UseColumnNames is also set to true.
{code}
{example}

{remarks}When {{ConvertStrings}} is set to {{true}} it will also affect column names when {{UseColumnNames}} is also set to true.
{remarks}