Rounding of digits and restricting character on a Text box

Posted by Punny under jQuery on 12/4/2013 | Points: 10 | Views : 7858 | Status : [Member] | Replies : 2
Dear Friends,

Could you please help me in achieving the below using Jquery

1) When a user enter the number with decimal places and leading zeroes the following should happen on save

The Leading Zeroes should be removed and a comma separator should appear automatically.

The after decimal places should always be two digits

E.g: 002398.456 = 2,398.46 AND
00123456.454=1,23,456.45

2) Input is restricted to 2 digits (for years) plus 2 digits (for months).

On display, to be rounded off to nearest 2 digits.

E.g:10.6(means 10 years 6 months) becomes 11.


3) Any input;On display, maximum 50 characters followed by 3 dots.

i.e. If a user enters 100 or 200 characters, the display should always be 50 characters followed by 3 dots.

Thank you all a lot in advance.

Regards
Punny




Responses

Posted by: vishalneeraj-24503 on: 12/5/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Please look into below URLs:-
http://stackoverflow.com/questions/891696/jquery-what-is-the-best-way-to-restrict-number-only-input-for-textboxes-all
http://stackoverflow.com/questions/11008605/jquery-input-limit-numbers-digits-to-4-but-text-can-be-infinite-length
http://stackoverflow.com/questions/19020607/preventing-user-to-enter-more-numbers-after-2-digits-before-decimal-point
http://blog.crowdint.com/2013/02/27/how-to-limit-two-decimal-digits-in-a-jquery-input-field.html

Punny, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response