Alexander
Alexander

Reputation: 20234

Ext.form.field.Number - formatting the value

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

Answers (1)

Renganathan M G
Renganathan M G

Reputation: 5209

I believe, Extjs supporting ordinal number only for date

Please Refer Here

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

Related Questions