Skip to content

Commit 3ee5b87

Browse files
committed
docs: Add a new 'group by function task.urgency' example
with precision not specified...
1 parent 9d95762 commit 3ee5b87

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

docs/Queries/Grouping.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,15 @@ group by function task.urgency.toFixed(3)
663663

664664
- Show the urgency to 3 decimal places, unlike the built-in "group by urgency" which uses 2.
665665

666+
```javascript
667+
group by function task.urgency
668+
```
669+
670+
- Show non-integer urgency values to 5 decimal places, and integer ones to 0 decimal places.
671+
- Sorting of groups by name has been found to be unreliable with varying numbers of decimal places.
672+
- So to ensure consistent sorting, Tasks will round non-integer numbers to a fixed 5 decimal places, returning the value as a string.
673+
- This still sorts consistently even when some of the group's values are integers.
674+
666675
<!-- placeholder to force blank line after included text --><!-- endInclude -->
667676
668677
### Recurrence

docs/Scripting/Custom Grouping.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,15 @@ group by function task.urgency.toFixed(3)
193193
194194
- Show the urgency to 3 decimal places, unlike the built-in "group by urgency" which uses 2.
195195
196+
```javascript
197+
group by function task.urgency
198+
```
199+
200+
- Show non-integer urgency values to 5 decimal places, and integer ones to 0 decimal places.
201+
- Sorting of groups by name has been found to be unreliable with varying numbers of decimal places.
202+
- So to ensure consistent sorting, Tasks will round non-integer numbers to a fixed 5 decimal places, returning the value as a string.
203+
- This still sorts consistently even when some of the group's values are integers.
204+
196205
<!-- placeholder to force blank line after included text --><!-- endInclude -->
197206
198207
### File property examples

0 commit comments

Comments
 (0)