Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Change the display of a number field on View Screen

I have a Number Field PO Number, in which I can input a max 10 digit numeric value.

After creating the issue, when I see the number on View Screen it displays as below, for e.g.

Create Screen: PO Number: 1111111111

View Screen: PO Number: 1,111,111,111

Since this number is not an amount; how do I display it without the commas?

Kindly suggest.

2 answers

0 votes

If you want rid of numeric separators, you can do that by changing the look and feel so that they do not display in number fields. 

Be aware that changing that affects all numeric fields, and makes them damn hard for humans to read.  The suggested code change has the same effect, and also makes your server unsupported.

Thing is, here, your PO number is not a number, it is a string (that happens to be made up of digits).  A far better option is to add a new short text field for it and remove the numeric version - this means actual numbers will continue to be shown in a readable form without affecting the simple string of digits that your PO "number" really is.

i want to get rid of numeric separators

 

could you please show me how do i get to this

Look and feel thing?

 

i don't want any numeric separators for all my fields

 

 

@Pranita Warik - This is a known issue and you may need to update the config file

https://confluence.atlassian.com/jirakb/remove-commas-for-values-held-in-number-field-custom-field-type-646250931.html

https://jira.atlassian.com/browse/JRASERVER-7582

 

If you don't want commas to be added, edit /WEB-INF/classes/templates/plugins/fields/view/view-number.vm. Replace the following line:

$!numberTool.format($value)

with:


$value.longValue()

@Niranjan 

I updated the file view-number.vm as below

#if ($customField.id == 'customfield_10900' && $value) //updated the id here
$value.longValue()
#elseif ($value)
$!numberTool.format($value)

But I do not see any change in the view screen. 

@Pranita Warik - Did you restart jira?

@Niranjan 

Even after restarting jira, the changes did not affect. Its still showing commas.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

463 views 3 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you