set value without symbol and pattern of number question

388 views
Skip to first unread message

nano...@gmail.com

unread,
Mar 23, 2015, 2:49:00 PM3/23/15
to suppor...@runmyprocess.com
I have two questions

I have an automoplete widget that obtains data from a collection. With the "Agregar" button I pass the value of all the text widget to an array widget, but the value of the price has the symbol "$" and I want to pass the value to the array widget without the symbol. How can I do that?

js of "agregar" button

id_section_view.open()
var count = id_arreglo.getRowsCount(); //get array rows
var sku = RMPApplication.get("sku_prueba");
var tipo = RMPApplication.get("tipo_prueba");
var categoria = RMPApplication.get("categoria_prueba");
var nombre = RMPApplication.get("nombre_prueba");
var precio = RMPApplication.get("precio_prueba");
if(temp==1)

{
var i=parseInt(count);
id_arreglo.insertRow(i); //add rows to array
id_arreglo.setVisible(true);
id_arreglo.id_categoria_view2[i].setValue(categoria);
id_arreglo.id_tipo_view2[i].setValue(tipo);
id_arreglo.id_sku_view2[i].setValue(sku);
id_arreglo.id_nombre_view2[i].setValue(nombre);
id_arreglo.id_precio_view2[i].setValue(precio);
}
else
{
var i=parseInt(count-1);
var temp=1;

id_arreglo.setVisible(true);
id_arreglo.id_categoria_view2[i].setValue(categoria);
id_arreglo.id_tipo_view2[i].setValue(tipo);
id_arreglo.id_sku_view2[i].setValue(sku);
id_arreglo.id_nombre_view2[i].setValue(nombre);
id_arreglo.id_precio_view2[i].setValue(precio);
}

what should be the pattern of the "total" text widget on the array to be the same as the "price" text widget?
pattern.jpeg
report.jpeg

Bidisha Das

unread,
Mar 24, 2015, 12:19:09 AM3/24/15
to suppor...@runmyprocess.com
Hi,
Since the price has $ in it,so total price is unable to recognise it and its giving"NAN", not a number. 

So you can unformat the Currency:Try with parseFloat(price.replace(/[^0-9-,]/g, '')); function in your code and check and let me know.


Thanks & Regards
Bidisha

Bidisha Das

unread,
Mar 24, 2015, 3:27:40 AM3/24/15
to suppor...@runmyprocess.com
Hi,
Sorry,did a small mistake in the above function. Use: var priceVal=parseFloat(price.replace(/[^0-9-.]/g, '')); and then set this value in the price column in array widget.

If decimal separator is (,) and not (.) then use parseFloat(price.replace(/[^0-9-,]/g, ''));

Thanks & Regards
Bidisha

Hernan Alberto Del Campo Cabezas

unread,
Mar 24, 2015, 9:00:17 AM3/24/15
to suppor...@runmyprocess.com
I used both but neither works

this one:

var priceVal = parseFloat(precio_prueba.replace(/[^0-9-,]/g, ''));

also, I used the other with "." but it is the same.

Imágenes integradas 1

"precio_prueba" is the variable value of precio text widget

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to a topic in the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this topic, visit https://groups.google.com/a/runmyprocess.com/d/topic/supportforum/coEn33xtZFE/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAMGV9zuVBD1AhRoyPUgmiNgRzmcytMT%3DYyJCRPUJC2Os%3DZt9eg%40mail.gmail.com.

Bidisha Das

unread,
Mar 24, 2015, 9:30:32 AM3/24/15
to suppor...@runmyprocess.com
Hi,
You need to first get the value of the price and store it in a variable using var price=RMPApplication.get("precio_prueba"); and then use 
var priceVal=parseFloat(price.replace(/[^0-9-.]/g, '')); and then set it to the column in array widget using widget_id.setValue(priceVal);


Thanks & Regards
Bidisha

Hernan Alberto Del Campo Cabezas

unread,
Mar 24, 2015, 10:19:47 AM3/24/15
to suppor...@runmyprocess.com
now I have no error but the price is not in the array

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to a topic in the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this topic, visit https://groups.google.com/a/runmyprocess.com/d/topic/supportforum/coEn33xtZFE/unsubscribe.
To unsubscribe from this group and all its topics, 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/.

Bidisha Das

unread,
Mar 24, 2015, 2:11:07 PM3/24/15
to suppor...@runmyprocess.com
Hi,
You can use : id_array.id_price[i].setValue(priceVal.toString()); . It would set the value in the array column.


Thanks & Regards
Bidisha

Hernan Alberto Del Campo Cabezas

unread,
Mar 24, 2015, 2:25:06 PM3/24/15
to suppor...@runmyprocess.com
thank you very much, it works so good :)

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to a topic in the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this topic, visit https://groups.google.com/a/runmyprocess.com/d/topic/supportforum/coEn33xtZFE/unsubscribe.
To unsubscribe from this group and all its topics, 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/.
Reply all
Reply to author
Forward
0 new messages