Skip to main content
Question

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


Forum|alt.badge.img

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

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • January 29, 2020

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.


Forum|alt.badge.img
erik_jan wrote:

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.


david_r
Celebrity
  • January 30, 2020
clickingbuttons wrote:

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.


Forum|alt.badge.img
david_r wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings