javascript - how to set currency change(cents) into a superscript using AngularJS currency? -


i turn price tag format:

enter image description here

is possible in angularjs? decimals in superscript format. far i'm using filer {{ pricetag | currency}} displays to:

enter image description here

if need build custom filter this, how go about? i'm not familiar angular filters, i'm still noob.

i found code, removes decimals. maybe if can modify , grab decimals in separate variable.

angular.module('your-module', []) .filter('mycurrency', [ '$filter', '$locale', function ($filter, $locale) {     var currency = $filter('currency'), formats = $locale.number_formats;     return function (amount, symbol) {         var value = currency(amount, symbol);         return value.replace(             new regexp('\\' + formats.decimal_sep + '\\d{2}'), '');     }  }]); 

or regex set apart decimals , turn 2 scopes. scope.price = '24' , scope.change = '92'. again, how go splitting price tag w/ regex.

your appreciated.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -