Hello,
I would like to create a textfield that can receive in input only numbers
and a comma. The dots should be added automatically like this: 123456 =
123.456.
But if i use a comma the result shoud be this one: 123456,789123 =
123.456,789123 (no dots after the comma)
I'm extending the textfield class and i'm using the numberFormat class to
format the number.
The problem is that i'm catching the "input" event and then format the
string, but the number is not formatted.
What do you mean with "the number"?
I need also to change the separator, in the documentation i've seen that the
separators are the opposite of what i need: "Whether thousand groupings
should be used {e.g. “1,432,234.65”}."
There's a good way to accomplish this ?
This separators depend on the language your app runs in. In the US, its the way
your example is. In germany, its also exactly the opposite so switching the
frameworks language to german works usually for germans e.g. Just take a look
at the API of the local manager in qx.locale to get some more details on that.
I'm using a filter to let only numbers be entered into the field:
this.setFilter(/[0-9]/); but i need to make possible also to enter a comma
(not more than one). I need a better regexp.
Thank you all for your support, I'm not very good with regexp. :)
I'm not the expert either and I didn't look at the docs but that could work:
/^[0-9|\.|\,]+$/
Regards,
Martin
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops? How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel