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 - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -