Forums

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

How to format a number field with formatted value

Calderara Serge
Contributor
April 22, 2022

Dear all,

I have a list of sub-stask which have a budget field value which is an Integer.

User are able to enter in this field freely number with different uncontrol format like :

Budget : 1234,5
Budget : 1234.5
Budget : 1'234,5
Budget : 1'234.5

What is the way to format correctly this field based on a standard number format for all users ?

The idea is that when all sub-task gets complete, I need to SUM all budget of all task and place the result in a calculated field. 

For that reason all number should be in same format

What is the best way to make this conversion format ?

regards

 

 

2 answers

1 accepted

1 vote
Answer accepted
Pramodh M
Community Champion
April 22, 2022

@Calderara Serge 

Use the number type custom field which only allows you to enter only the numbers

Thanks,

Pramodh

Calderara Serge
Contributor
April 25, 2022

thanks

Like Pramodh M likes this
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2022

Er, number fields allow decimals, that's the whole point of the question.

Pramodh M
Community Champion
April 27, 2022

Seems like @Calderara Serge is okay with the approach 🙂

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2022

There's a number of things you could do here with Scriptrunner:

  • Create a validator that tells people not to have fractions when creating or transitioning the issues
  • Have a listener that picks up create and edit, reads the current value and rounds it
  • Have a Behaviour fix the input (I'm not sure this can be done though, I don't use Behaviours a lot)
Pramodh M
Community Champion
April 27, 2022

We don't want to bring more complex configuration on how user enters the data while creating the issue! Correct?

Suggest an answer

Log in or Sign up to answer