I have an angularjs properties that contain a float that I display like this :
{{fraisDeDep.kilometre}}
The display is : 45,4564
How to display 45,45 without have a function that destroy the binding ?
Does the method working for {{fraisDeDep.kilometre * fraisDeDep.indemniteKilometre *fraisDeDep.allerretour}} ?
You can use the built-in number filter for this:
<div>{{fraisDeDep.kilometre | number:2}}</div>
The default fractionSize
is 2
, so you can also leave it off in this case:
<div>{{fraisDeDep.kilometre | number}}</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With