javascript - How to use International place Value System on HTML TextBox -
i'm working on web app. app has text box. user come in dollar value text box. user typing, include commas when appropriate. in others, if user enters "100", text appear entered. however, if user enters "1000", automatically convert text in text box show "1,000".
is there plugin help this? i'm having problems finding one. i'm using bootstrap.
thanks!
hope below code help you
var x=123456524578; x=x.tostring(); var res = x.replace(/\b(?=(\d{3})+(?!\d))/g, ",") ; alert(res); follow below link
working fiddle
now append above output textbox or wherever want. logic lies above,how utilize international place value system
javascript twitter-bootstrap
No comments:
Post a Comment