- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Round to nearest 0.5
Created:
Sep 24, 2018 02:32 PM
| Last Modified: Sep 24, 2018 11:33 AM
(9545 views)
| Posted in reply to message from pcannonsamsung 09-24-2018
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 );
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Round to nearest 0.5
Created:
Sep 24, 2018 02:32 PM
| Last Modified: Sep 24, 2018 11:33 AM
(9546 views)
| Posted in reply to message from pcannonsamsung 09-24-2018
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 );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Round to nearest 0.5
Created:
Sep 24, 2018 02:39 PM
| Last Modified: Sep 24, 2018 11:40 AM
(9542 views)
| Posted in reply to message from pcannonsamsung 09-24-2018
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.