internationalization - Convert string to number using i18n in AngularJS -


using ng.ifilterservice in angularjs can convert number string. numberfilter uses i18n determine if needs period or comma format number.

like so:

var numberstring = $filter('number')(1.1234, 2); // numberstring = 1,12 when using i18n nl-nl (netherlands) 

what looking for, , far haven't found, how in reverse.

when having string value '1,12' , knowing i18n setting decimal separator (in case comma) 1 know enough convert back. although can't find method in angularjs this.


Comments

Popular posts from this blog

php - Extract Text from HTTP referer -

java - Callback from new thread to class from which thread was initiated -

Receive udp packets in android gstreamer -