From a data table generated from a text file, I extract a column with numeric values. The problem is that when I write it to the file I need, it pastes it without formatting.
When concatenating the data, it includes the .00, and I need to prevent this.
That is, if the quantity is 545.00, I need it to only consider “545” when concatenating, but if the quantity is 545.42, then it should include the decimals.
Your approach works to convert the value to a Double, but it may still show .00 for whole numbers when you convert it back to a string.
To drop .00 only for whole numbers, update the assign with:
If CDbl(CurrentRow("ColumnName").ToString.Trim) Mod 1 = 0 Then
CurrentRow("ColumnName") = CInt(CurrentRow("ColumnName")).ToString
Else
CurrentRow("ColumnName") = CDbl(CurrentRow("ColumnName")).ToString
End If