Format number with Globalization plugin

0

I'm trying to use the cordova.plugin-globalization plugin but I'm running into my little Javascript experience.

xhtml:

<div>{{ item.valor | formataValor }}</div>

filter.js:

app.filter('formataValor',function(){
   return function(valor){
       console.log('globalization: '+valor)
       navigator.globalization.numberToString(
           valor,
           function (number) {
               console.log('numero formatado:' + number.value);
               return number.value;
           },
           function () {
               console.log('erro de formatacao de valor');
           },
           {type: 'currency'}
       );
   }
});

Apparently the return of the navigator.globalization.numberToString function is missing, since the console output is ok.

    
asked by anonymous 22.08.2016 / 18:37

0 answers