AngularJS - Smart Float Directive

Recently I started looking for an AngluarJS directive to validate numbers and I found the "smart-float" directive here, in the AngularJS documentation. This amazing example solves the problem of convert my numbers that use a comma as decimal mark to a Javascript number.

My problem is that this directive doesn't solve my two problems:

Display numbers with 2 fractional digits by default.

Validate numbers with thousands separator.

So, this is an improved directive based on Angular's smart-float directive.
First, add the following directive to your application: