I want to get this format In USD : 1.123.362,32 and this format in euro :1,122,363.33 I used AngularJS Filter "currency" who Format a number to a currency format but without separtors like "," "."
2 Answers
Use a Filter
here is a link to the docs where you can see an example.
You need to use the currency filter to get the desired effect. It should look like this
HTML
{{ currency_expression | currency : symbol : fractionSize}}
JS
$filter('currency')(amount, symbol, fractionSize)
To do this with the correct , or . you need to have the correct currency format selected.
Math.round()
inside your controller when you are setting the scope make sure you do Math.round() so the number you return is always whole.
Example
Math.round(2.5);
Alternatively
If the currency filter does not meet your requirements you can always use the number format that Angular provides, Doc are here
HTML
{{ number_expression | number : fractionSize}}
JS
$filter('number')(number, fractionSize)
If All Else Fails
Create your own custom filter here is a tutorial on how to build your own custom filter in angular, since your requirements are a little strange you should consider building your own filter to match them. This way you can set your , or . and anything that precedes or follows your number.
Its definitely more difficult than using the built in functionality but since you cant get it to match up with either of the methods above I would take this route.

- 19,471
- 7
- 53
- 81
-
do that in your controller before sending it to the front. like `Math.round(2.5);` – Joe Lloyd Jan 05 '16 at 09:08
-
I want to get this format without fractionSize . exemple of kendo ui template currency : template: "#= kendo.toString(2363633, 'c', 'fr-FR')#" , the result : 2 363 633,00 € template: "#= kendo.toString(2363633, 'c', 'en-CA')#" , the result : $ 2,363,633.00 Ususally € after the variable and $ before variable – hayfa chabbouh Jan 05 '16 at 09:19
currency angularjs's filter does not deal comma in usd and point in euro.... I used kendo ui like the filter in grid,it deal all event : kendo.toString(236, 'c', fr-FR); hope we find a complete solution with angularjs.

- 5
- 3