Q:

ExtJS: How to get decimal number value

I used decimalSeparator property of numberfield and set it to ',' (comma).  Now I have problem reading value as number and doing math with it. 
I first tried simple:
var v = form.getForm().getValues().myfield / 2

As soon s I type comma, v becomes NaN.
Then I tried:
var v = Ext.util. Format.number(form.getForm().getValues().myfield, "0.000,00") / 2

As soon a I type comma, v becomes 0. 
I also tried combinations with /i in format string but id didn't help either. 
What am I missing? 

A:

The problem is that getValues does not work as you expect.  From the documentation of getValues (emphasis mine): 

Note: The values are collected from all enabled HTML input elements within the form, not from the Ext Field objects.  This means that all returned values are Strings (or Arrays of Strings) and that the value can potentially be the emptyText of a field. 

If you want to ensure that you have a decimal value, you will have to do something like the following:
var v_string = form.getForm().getValues().myfield; //get the string
v_string = v_string.replace(",", ".");  //replace ',' with '.' 
var v = (+v_string) / 2; //convert the value to a decimal and divide by 2

EDIT
You could also try using the getFieldValues (i.e. form.getForm().getFieldValues()) method instead of the getValues method.  This should act as though you had called getValues on every form field. 

A:

This should work. 
var value = parseFloat("5000,5".replace(",", "."));