Forums

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

Change the display of a number field on View Screen

Pranita Warik September 30, 2020

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
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.
September 30, 2020

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.

Nathan January 5, 2022

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

 

 

0 votes
Niranjan
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.
September 30, 2020

@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()

Pranita Warik September 30, 2020

@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. 

Niranjan
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.
September 30, 2020

@Pranita Warik - Did you restart jira?

Pranita Warik October 8, 2020

@Niranjan 

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

Suggest an answer

Log in or Sign up to answer