How to convert JSON digit to comma value

123 views
Skip to first unread message

Alan

unread,
Nov 25, 2015, 10:26:46 PM11/25/15
to Fujitsu RunMyProcess Developer Community
Hi Team,

This is array value and this value should be used generating pdf file via process.
But as you see, all number values has no comma. How to replace or handle this number value?

When a user see this array in WI, it shows comma. But in process variable, it is like this.

{"array_price":["1200000","400000","350000"],"note":["null","",""],"array_unit":["1","2","1"],"array_total":["1700000","800000","350000"]}


This is what I wanted.

{"array_price":["1,200,000","400,000","350,000"],"note":["null","",""],"array_unit":["1","2","1"],"array_total":["1700,000","800,000","350,000"]}

Can you help this?

Regards,
Alan.

Pankaj Kumar

unread,
Nov 26, 2015, 7:03:13 AM11/26/15
to Fujitsu RunMyProcess Developer Community
HI Alan,

Please try to set the below template in freemarker to get the "," Delimiter (seperated by) on Number.

<#setting number_format=",##0.00">
<#setting locale="en_US">

By setting this number formatting, ${12345678} will return 12,345,678.00.


Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support


--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/5942cf48-635b-4838-a12d-4ee09621f883%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

al...@wedosoft.net

unread,
Nov 26, 2015, 10:42:34 PM11/26/15
to Fujitsu RunMyProcess Developer Community
Hi Pankaj,

Thanks for your reply. I already tried to that. it works wel. But when I use json variable, it doesn't work.

For example,

if the "my_array" value of variable is like this,

{"array_price":["1200000","400000","350000"],"note":["null","",""],"array_unit":["1","2","1"],"array_total":["1700000","800000","350000"]}

I tried like this.

<#setting number_format=",##0.00">
<#setting locale="en_US">

${my_array}

And number value is same. it doesn't work. Can you help this?

Thanks

Regards,
Alan.

al...@wedosoft.net

unread,
Nov 27, 2015, 3:31:36 AM11/27/15
to Fujitsu RunMyProcess Developer Community, al...@wedosoft.net
Hi Pankaj,

I resolved this using xslt decimal grammer like this.

<xsl:value-of select="format-number(number, '#,###')"/>

It works well. You can completed this question.

Thanks Pankaj,

Regards,
Alan.
Reply all
Reply to author
Forward
0 new messages