angularjs - Parse amount in input in Javascript -
i have input in form user have write amount pay. problem user have different ways it, 1,350.55 (this correct one), 1.350,55 or 1.350. so, there way parse amount correct form?
thanks!
you want parse input, right? why not try make input currency field? , parse container through angular, customers may see value , work angular filtered value.
here fiddle: http://jsfiddle.net/lacrioque/voulmrac/
<p><label for='numberinput'>your price here: </label><input type='number' name='numberinput' ng-model='numbertofilter' placeholder="1,350.99"/></p> <p>price: <span>{{numbertofilter | currency }}</span></p>
Comments
Post a Comment