Hello, I have a question in regard to rounding. As an example I have a data like this:
Suppose, I have also number like 0.12, 0.76, 1.3, 1.7 etc. Now, I would like to have all number between 0 and 1 to be rounded as 0.5 and all between 1 and 2 as 1.5 and so on. I was thinking of
but this is not quite the same I was searching for.
Code:
list z in 1/20
+----------+
| z |
|----------|
1. | 0 |
2. | 0 |
3. | 0 |
4. | 0 |
5. | 11.36438 |
|----------|
6. | 0 |
7. | 7.6 |
8. | 0 |
9. | 0 |
10. | 0 |
|----------|
11. | 0 |
12. | 0 |
13. | 4.654795 |
14. | 3.484931 |
15. | 0 |
|----------|
16. | 6.446575 |
17. | 0 |
18. | 0 |
19. | 21.06575 |
20. | 3.353425 |
+----------
Code:
round(z, 0.5)

Comment