Question

Possible Duplicate:
Dojo: how to remove comma from value

For some reason, my NumberSpinner always displays numbers above 999 as comma-separated (1,001). Is there a way to make that spinner display the non-comma separated value to the user?

Was it helpful?

Solution

You can use the replace() method to remove the commas and replace them with an empty string.

var number = "1,001";
console.log(number.replace(/\,/g, ""));

Another way I found (here) is to add the following to your constraints object

pattern:'#'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top