Beginning AngularJS

(WallPaper) #1
Chapter 4 ■ Filters and Modules

Listing 4-4. Rounding Up Values with the Number Filter


<!DOCTYPE html>




Listing 4-4





Consumption: {{data.consumption }}

Consumption: {{data.consumption | number }}




Figure 4-2 shows both the unfiltered and filtered data generated within the paragraph element. This is a slight
improvement, as now we have just three digits after the decimal point, instead of six.


Figure 4-2. Rounding up numbers with the number filter

Free download pdf