ionic AngularJS currency filter remove currency symbol and decimal points

ionic AngularJS currency filter remove currency symbol and decimal points. If you want to use AngularJS currency filter and want to remove currency symbol and decimal points after dot, here is solution.

currency filter

Formats a number as a currency (i.e. $1,234.00). When no currency symbol is provided, default symbol for current locale is used.

Now if you want to remove $ symbol and .00 point value from result string. Here is simple code for remove both from currency format string.

AngularJS remove currency symbol and decimal points for INR currency string


{{(amount | currency : 'INR' : false : '2.0-0').replace('INR', '')}}

AngularJS remove currency symbol and decimal points for $ currency string


{{(amount | currency : '$' : false : '2.0-0').replace('$', '')}}

AngularJS remove currency symbol from currency filter string

Using normal string replace function, we can remove currency symbol from currency filter string output.

AngularJS remove decimal points from currency filter string

Using fractionSize (Number of decimal places to round the amount to, defaults to default max fraction size for current locale), we can remove decimal points from currency filter string output.

In above example code ‘2.0-0’ is fractionSize.