Question

Why can't I just assign a data type to a field?!

  • 29 January 2020
  • 4 replies
  • 3 views

Badge

I'm having trouble with a relatively simple task - I want a field to be a specific data type (DOUBLE). The source for the values is a text field with a number (comma separator). However no matter what I try (e.g. creating a brand new field with @Evaluate(@double(@Value(MYTEXTFIELD))) or replacing comma with dot beforehand), it ends up as (as seen by ArcMap) text. StringFormatter didn't work either: the decimal option gives me (textual) scientific notation - yuck! Give me proper decimals or give me DEATH!


4 replies

Userlevel 2
Badge +12

This has been suggested in this idea:

https://knowledge.safe.com/content/idea/33211/set-data-type-option-within-the-attributemanager.html

Please it up to get the functionality in a next release.

Badge

This has been suggested in this idea:

https://knowledge.safe.com/content/idea/33211/set-data-type-option-within-the-attributemanager.html

Please it up to get the functionality in a next release.

Done! I forgot about changing the type in the writer. This does work however FME seems to automatically round on the sixth decimal place no matter what length and precision I set. Guess I'll leave it as text and fix the format in ArcMap.

Userlevel 4

Done! I forgot about changing the type in the writer. This does work however FME seems to automatically round on the sixth decimal place no matter what length and precision I set. Guess I'll leave it as text and fix the format in ArcMap.

I doubt that FME is rounding the decimals, it is probably either

a) the storage data type that doesn't support more than 6 significant digits, e.g. fixed-precision datatypes such as "decimal(12,6)"

b) or the on-screen representation in ArcMap, where the decimals are rounded to the 6th position for legibility.

You can test the hypothesis by re-reading the data from your File Geodatabase using FME and checking the decimal values.

Badge

I doubt that FME is rounding the decimals, it is probably either

a) the storage data type that doesn't support more than 6 significant digits, e.g. fixed-precision datatypes such as "decimal(12,6)"

b) or the on-screen representation in ArcMap, where the decimals are rounded to the 6th position for legibility.

You can test the hypothesis by re-reading the data from your File Geodatabase using FME and checking the decimal values.

Dang, you're right. Map defaults to 6 no matter what the input says, but that can be changed.

Reply