cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar

Round to nearest 0.5

Hi,

 

I'm wondering if there is a way to use a formula to round numbers to the nearest 0.5 .

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Round to nearest 0.5

You can use this for a column formula:

 

Round( :Data * 2 ) / 2

Or you could make your own function in a script:

 

nearest half = Function( { x }, Round( x * 2 ) / 2 );

View solution in original post

2 REPLIES 2

Re: Round to nearest 0.5

You can use this for a column formula:

 

Round( :Data * 2 ) / 2

Or you could make your own function in a script:

 

nearest half = Function( { x }, Round( x * 2 ) / 2 );
gzmorgan0
Super User (Alumni)

Re: Round to nearest 0.5

x = [122.34, 10.2, 33.6, 45.75];

show( round( x/0.5,0 )*0.5 );

/*:
Round(x / 0.5, 0) * 0.5 = [122.5, 10, 33.5, 46];

 oops, Mark beat me to it.