The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Mikes Trello Tips - 🧮 Round Custom Field Number Up⬆️ or Down ⬇️

Mikes Trello Tips - 🧮 Round Custom Field Number Up⬆️ or Down ⬇️

Following on from Mikes-Trello-Tips: Automation to truncate a numeric custom field...

This is a very quick article showing how to round a number up or down in Trello using automations and regex.

For this to make sense, please first read the article above!! ☝🏽

This simple example is just for rounding up to a whole number but you could do it for decimal points also by modifying the automations similar to the examples given in the guide above.

Numbertrick.gif

What we are doing

  1. Matching the before the decimal place:
    40.12345
  2. Matching if the number after the decimal place
    1.  If it matches 0-4
      40.12345
    2. If it matches 5-9
      40.5678
  3. If it matches:
    1. 0-4: Set the field to the 40
    2. 5-9: Set the field to 40+1

Now, the Automations:

 

Automation 1

when custom field "Age" is set to "regex:/(\d*)\.(\b[0-4]).*/", set custom field "Age" to "{wildcard1}"

Screenshot 2023-10-15 095829.png

Automation 2

when custom field "Age" is set to "regex:/(\d*)\.(\b[5-9]).*/", set custom field "Age" to "{wildcard1} +1"

Screenshot 2023-10-15 095928.png 

 

 

1 comment

Comments for this post are closed

Community moderators have prevented the ability to post new comments.

tkelly
May 17, 2024

Thank for posting this.  This worked like a champ!  

TAGS
AUG Leaders

Atlassian Community Events