String.ToNumber - converting of imported csv-values, formatted as str -> wrong conversion results

Thanks in advance for your input.

Target of my dynamo skript is to create levels with predefined names and elevation heights with Level.ByElevationAndName, which are imported from excel.

Level.ByElevationAndName expects double values as input, so i tried to convert the excel comma separated values (which are imported as str) to double, which leads to 2 problems:

  1. csv values (e.g. 3,6) are converted to 36 (expected: 3,6)
  2. values without comma get converted to Object.Type System.Int64 (expected: System.Double). This is maybe not a big problem, because it seams, that System.int64 is also accepted as input type.

I tried to change the delimiter in excel from β€œ,” to β€œ.”, but this makes no difference - levels with csv-elevation heights are still positioned in a wrong height.

I think itΒ΄s more a formatting issue. How can i solve this problem? How can i format my excel input, that the conversion is correct?

EBENEN-RASTER-FILE 554 - EBENEN_HΓ–HEN.xlsx (17.3 KB)

AW_CREATE_LEVELS_BY_LIST.dyn (100.6 KB)

Hi,
and replacing the , by a . with string replace in Dynamo? That should do the trick/

1 Like

Thank you, replacing the char β€œ,” solved the issue. :slight_smile:

I replaced the β€œ,” with β€œ.” with String.ReplaceIllegalChars node from package:Springs.

1 Like