Skip to main content
Question

Display numbers up to three decimal places

  • December 2, 2021
  • 3 replies
  • 1175 views

arash_hokm
Contributor
Forum|alt.badge.img+8

Hello FME community,

 

I have a long number (see the picture). I want only up to 3 decimal places to be displayed.

 

the nummberThanks in advance for your help

 

3 replies

birgit
Influencer
Forum|alt.badge.img+16
  • Influencer
  • December 2, 2021

Hi

You can use the attribute rounder transformer for this. Set the decimal to 3. However I think your problem is that your data has the wrong delimiter, FME uses a full stop as the decimal delimiter instead of the comma.

So if the attribute rounder doesn't seem to work for you it is probably because FME thinks that your attribute is a string instead of a number.

 


arash_hokm
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • December 2, 2021
birgit wrote:

Hi

You can use the attribute rounder transformer for this. Set the decimal to 3. However I think your problem is that your data has the wrong delimiter, FME uses a full stop as the decimal delimiter instead of the comma.

So if the attribute rounder doesn't seem to work for you it is probably because FME thinks that your attribute is a string instead of a number.

 

Thanks alot

 


warrendev
Enthusiast
Forum|alt.badge.img+23
  • Enthusiast
  • December 2, 2021

Another solution would be to use the string formatter. In this example my number is 0.123456 and I want it to only display 3 places past the decimal. I will use the format string of .3f to do this.

0.123456 -> 0.123

https://docs.safe.com/fme/2021.1/html/FME_Desktop_Documentation/FME_Transformers/Transformers/stringformatter.htm

example


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