number format in report widget

305 views
Skip to first unread message

J.M.

unread,
Dec 2, 2016, 6:03:40 AM12/2/16
to Fujitsu RunMyProcess Developer Community
Hi,



I've the following issue I don´t know how to solve:

I'm saving some data in a collection, and there is a field which is number type. When I add this field to a report widget and I set the type as number, the default format is ',' for representing thousands, and '.' for representing decimals, however I would like these characters on the opposite, that is ',' for decimals, and '.' for thousands.

How could I get this format?



Thanks in advance
Regards.

Murali

unread,
Dec 2, 2016, 7:18:34 AM12/2/16
to Fujitsu RunMyProcess Developer Community, javiermm...@gmail.com
Hi Javier,

Below is the code sample for your requirement and update accordingly. Userguide Reference.

var super_amount = 23442.897;
Number.prototype.formatMoney = function(c, d, t, p){
var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
   return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
};
console.log(parseFloat(super_amount).formatMoney(2, ',', '.'));

Regards,
Murali
Fujitsu RunMyProcess Support

J.M.

unread,
Dec 2, 2016, 8:07:07 AM12/2/16
to Fujitsu RunMyProcess Developer Community, javiermm...@gmail.com
Hi Murali,



Thanks for the help, and sorry for not making an more exact question. I has seen that code before, but where/how should I add it? As a JS in the WI which contains my report widget? as a JS script in my column of the report widget? Maybe a new column (calculated) in that report?
I don't get to make it work.

Could you please, show me any example?



Thaks again and regards.

Pankaj Kumar

unread,
Dec 3, 2016, 2:39:33 PM12/3/16
to Fujitsu RunMyProcess Developer Community
Hi Javier,

Please refer to attached screen-print to use the js code shared previously.

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+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://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/5e87fcd5-784f-41ef-816f-4f7a6bd7bd1f%40runmyprocess.com.

1.png
2.png
3.png
4.png

javiermm...@gmail.com

unread,
Dec 5, 2016, 2:52:57 AM12/5/16
to Fujitsu RunMyProcess Developer Community
Hi Pankaj,



Thanks for the example. I've got it to work. However, I've lost the filters and the ordenation in the calculated field with the desired format, and I would need to maintain all the features: the format, the filters and the ordenation in the same field.

How can I achieve that?



Thanks again and regards.
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.

J.M.

unread,
Dec 5, 2016, 5:52:04 AM12/5/16
to Fujitsu RunMyProcess Developer Community, javiermm...@gmail.com
Hi again,



I would want to add one more question:
In order for changing the format number in a number input field, should the same solution works?
I'm experimenting a weird situation. I have many number input fields, and I'm trying to do the following in a JS widget:
var n = RMPApplication.get("minimo_welcome");
console.log("minimo_welcome = " + n);
//change format
//RMPApplication.set (...);

where minimo_welcome is the variable's name of one of my number input widgets, but I'm getting null as result. I've tried the get function in the javascript console in Chrome, and it returns the value of my field.
What's happening and why?



Thanks again and regards

Pankaj Kumar

unread,
Dec 5, 2016, 6:29:48 AM12/5/16
to Fujitsu RunMyProcess Developer Community
Hi,

In Report "calculated column", you can not apply any filter.

Reference Link:-

Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support

To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

Pankaj Kumar

unread,
Dec 5, 2016, 6:32:53 AM12/5/16
to Fujitsu RunMyProcess Developer Community, javiermm...@gmail.com

Hi,

Regarding your second query:-  changing the format number

Kindly give us more details on the scenario and if possible please share screen-print for reference as I am not able to understand it.

J.M.

unread,
Dec 5, 2016, 7:00:36 AM12/5/16
to Fujitsu RunMyProcess Developer Community, javiermm...@gmail.com
Hi,



Let me explain.
I wanted to change the format number too in some input field (type number) which I have in a WI. So I thought that one way to do this could be getting the value, changing the format with the mentioned function, and setting the value again. In order to do so, I'm trying to get the value with RMPApplication.get(), but that's returning null and I' don't understand why.
For debugging the code, y simply write the get and the console.log functions in my script, and I've tried in the Google Chrome js console too, for asuring the value of my field (I attach images for all this).
So..
Regarding to the get function:
1- What's happening with my fields? Why is the returned value null?
Regarding to the change format
2 - Re-thinking the whole method... If the sequence get-format-set works fine... Is it good for change the format? Now, I'm thinking, that for getting this to work, the fields should be text, and I would need to eliminate the characters like ',' or '.' later for operating with them, right?
I only need that in the number input fields, the numbers are seen with ',' for decimals and '.' for thousands...

I hope my question is more clear now. @_@



Thanks again and regards.

Pankaj Kumar

unread,
Dec 7, 2016, 3:40:52 AM12/7/16
to Fujitsu RunMyProcess Developer Community, Javier Martín
Hi Javier,

As your question relates to coding and process design specific to your application, unfortunately we cannot assist you with this issue as application-specific support is not included in the license agreement. Please contact our sales team to discuss the support options that would help us resolve application issues as soon as possible.

Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support

To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
Reply all
Reply to author
Forward
0 new messages