Skip to main content
Does anyone know how to round an attribute value up to nearest 100 ? For example if I have a value 1367 I want it to be rounded to 1400. And if I have a value of 1305 I also want it to bo rounded to 1400. I tried the AttributRounder, but it seems to only round decimal values.

 

//Eva
Hi Eva,

 

 

Try this expression with the ExpressionEvaluator.

 

-----

 

@ceil(@Value(attribute_name)*0.01)*100

 

-----

 

 

See the help on the ExpressionEvaluator to learn more about @ceil function.

 

 

Takashi

 

Hi Eva,

 

 

The AttributeRounder works fine, if you write -2 for Decimal Places.

 

 

 

Thomas
or

 

(@round((@Value(Nr_to_R)+100)/100))*100
I didn't know a negative value can be used for Decimal Places of the AttributeRounder. It's simple and works fine. Thanks for sharing the tips, Thomas!
Tho u can use positive or negative rdecimals in the rounder, it has less degrees of freedom.

 

 

So if u would want ot round to say 200 or 2, or even better yet 3 (no multiplication by 10 possible now..;) it would be of no use.

 

 

(@round((@Value(Nr_to_R)+100)/100))*100 gives full freedom, u can parameterise the values.

 


Gio, does the expression always work as your expecting?

 

1400 --> ?

 

1350.0 --> ?
thank you all for the solutions, it's working now!
...ok....that would be (@round((@Value(Nr_to_R)+99)/100))*100

 

 

:)

 


Reply