Reputation: 20234
I have an Ext.form.field.Number where I can insert a number or use the spinner to select one.
How do I format this value for display in the Ext.form.field.Number field?
Let's say I want to have displayed, when you spin up or down:
1st
2nd
3rd
...
or
one
two
three
...
Upvotes: 0
Views: 455
Reputation: 5209
I believe, Extjs supporting ordinal number only for date
You can use this function to achieve that
function getGetOrdinal(n) {
var s=["th","st","nd","rd"],
v=n%100;
return n+(s[(v-20)%10]||s[v]||s[0]);
}
Upvotes: 2