1

I have 1 model as follows:

 Product: 
    public int id
    public int price

in my view i want use jquery auto format thousand separator for text box price when user input price ( i want format immediately when user input)

example: when user input
123 -> 123
4567 -> 4,567
45678 -> 45,678
456 -> 456

sorry my english not good thanks so much!

DevT
  • 4,843
  • 16
  • 59
  • 92
Tam Luong
  • 11
  • 2
  • I would use jQuery plugins for things like that – meda Aug 14 '13 at 03:44
  • Here's something to get you started: http://stackoverflow.com/questions/1990512/add-comma-to-numbers-every-three-digits-using-jquery This one does not appear to operate on a control during input, but it should be easy enough to adapt. Hope that helps. EDIT: one of the comments in the accepted answer has another person's attempt at using the algorithm for an input control. Good luck. – David Tansey Aug 14 '13 at 04:36

0 Answers0