Skip to main content
Solved

Round numbers to the nearest 0.05

  • February 20, 2020
  • 4 replies
  • 119 views

Forum|alt.badge.img

Hello,

I would like to round numbers to the nearest 0.05. Like this:

-2.33 > -2.35

-2.32 > -2.30

Is this possible within the AttributeRounder? Or how can I get this result?

 

Thanks in advance,

Eva

Best answer by ebygomm

You can do this in an attribute creator

@round(@Value(number)*20)/20.0

 

View original
Did this help you find an answer to your question?

4 replies

ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • Best Answer
  • February 20, 2020

You can do this in an attribute creator

@round(@Value(number)*20)/20.0

 


takashi
Evangelist
  • February 20, 2020

A possible way is: multiply the original value by 2, round the resulting value with the AttributeRounder (Decimal Places: 1, Round Off Direction: Nearest), divide the resulting value by 2.


Forum|alt.badge.img
  • Author
  • February 20, 2020
ebygomm wrote:

You can do this in an attribute creator

@round(@Value(number)*20)/20.0

 

Ah yes that works! Thanks for the quick reply :-)


Forum|alt.badge.img
  • Author
  • February 20, 2020
takashi wrote:

A possible way is: multiply the original value by 2, round the resulting value with the AttributeRounder (Decimal Places: 1, Round Off Direction: Nearest), divide the resulting value by 2.

This also works, thanks!


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