Skip to main content

Here are some examples:

original data

497.2594497509648

497.3865

495.31

495.29

expected result:

497.2

497.4

495.4

495.2

And I have another case where I want to round my list of numbers to the closest of four options: integer, ending with .25 or ending with .5 or ending with .75.

my examples:

original data

497.2594497509648

497.8865

495.77

495.45

expected result:

497.25

498

495.75

495.5

thank you.

In your examples, you inconsistently round - eg 497.3895 and 495.31 both round up to xxx.4, whereas 495.29 rounds down to 495.2.

 

Scenario 1, use the AttributeRounder

scenario 2, use the following statement - @Evaluate(@round(@Value(_list)*4,0)/4)

 

 


Scenario 1, multiply by 5, round, then divide by 5 

@round(@Value(attrib1) * 5) / 5

 


In your examples, you inconsistently round - eg 497.3895 and 495.31 both round up to xxx.4, whereas 495.29 rounds down to 495.2.

 

Scenario 1, use the AttributeRounder

scenario 2, use the following statement - @Evaluate(@round(@Value(_list)*4,0)/4)

 

 

@katt​, misread the first part re even numbers. @danatsafe​  gives the correct answer :)


Reply