Forums

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

Format number in jmcf

Antonio Caeiro October 3, 2022

Hi,

i need to format the following number 200,000% to 200% in JMCF.

Any advise?

 

 

I'm using this code in Number Format Expression form Groovy script that returns a string representing the value of the calculated number custom field.

 

value
numberTool.format('percent',value)

tks

 

format.PNG

1 answer

1 accepted

1 vote
Answer accepted
David Fischer
Community Champion
October 3, 2022

Hi @Antonio Caeiro ,

it looks like the calculated value is 2000, not 2. A value of 2000 would be displayed as 200,000% (with the thousands-separator comma). You can check this by removing the number format expression. In that case, you have 2 options:

- update the "Formula" to return 2 instead of 2000 (divide the value by 1000)

- update the number format expression to divide the number by 1000: 

numberTool.format('percent',value/1000)

Suggest an answer

Log in or Sign up to answer