How do I format a number in RPE?
RPE 6.0.6.1 iFix 21
Using Rational Publishing Engine Document Studio
Trying to publish a value from RTC > WorkItem > AllExtensions > DisplayValue
Number is provided to RPE as (for example) 1000.10
I want to show this as 1,000.10
I have tried parseFloat(displayValue).toLocaleString('en-GB') but this doesn't work (invalid radix?)
Also tried just displayValue.toLocaleString('en-GB') but this returned [object String]
Any other ways?
Many thanks!
|
Accepted answer
I supposeĀ displayValue is string. In that case, you can use the following Script Expression in RPE:
displayValue.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
Glyn Costello selected this answer as the correct answer
Comments
Glyn Costello
commented Mar 18 '22, 5:46 a.m.
Thank you. Shame the JavaScript locale functions don't work.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Please add appropriate tags to this question, thanks.
I've added a couple more tags