Domanda

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?

È stato utile?

Soluzione

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:'#'
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top