# Math - [`bytes`](#bytes) - [`ceil`](#ceil) - [`floor`](#floor) - [`round`](#round) - [`degrees`](#degrees) - [`radians`](#degrees) - [`random`](#random) - [`pow`](#pow) - [`sqrt`](#sqrt) - [`abs`](#abs) - [`ordinal`](#ordinal) You can check the module import [`here`](./modules.md). #### bytes Returns the bytes to an human-readable format. ##### File ```typescript import { NgBytesPipeModule } from 'angular-pipes'; ``` ##### Usage ```html {{ 150 | bytes }} {{ 1024 | bytes }} {{ 1048576 | bytes }} {{ 1024 | bytes: 0 : 'KB' }} {{ 1073741824 | bytes }} {{ 1099511627776 | bytes }} {{ 1073741824 | bytes : 0 : 'B' : 'MB' }} ``` ##### Todo - Be able to change the input unit. #### ceil Ceils a number with a given precision. Take a look at the official documentation on ceil. ##### File ```typescript import { NgCeilPipeModule } from 'angular-pipes'; ``` ##### Usage ```html {{ 3.4 | ceil }} {{ 1.5 | ceil: 1 }} {{ 1.5444 | ceil: 2 }} ``` #### floor Floor a number with a given precision. Take a look at the official documentation on floor. ##### File ```typescript import { NgFloorPipeModule } from 'angular-pipes'; ``` ##### Usage ```html {{ 3.4 | floor }} {{ 1.5 | floor: 1 }} {{ 1.5444 | floor: 2 }} ``` #### round Rounds a number with a given precision. Take a look at the official documentation on round. ##### File ```typescript import { NgRoundPipeModule } from 'angular-pipes'; ``` ##### Usage ```html {{ 3.4 | round }} {{ 3.5 | round }} {{ 1.5 | round: 1 }} {{ 1.5444 | round: 2 }} {{ 1.345 | round: 2 }} ``` #### degrees Converts radians to degrees. ##### File ```typescript import { NgDegreesPipeModule } from 'angular-pipes'; ``` ##### Usage ```javascript this.value = Math.PI; ``` ```html {{ value | degrees }} ``` #### radians Converts degrees to radians ##### File ```typescript import { NgRadiansPipeModule } from 'angular-pipes'; ``` ##### Usage ```html {{ 180 | radians }} ``` #### random Returns a random number between a minimum (default: 0) and a maximum (default: 1). The input is ignored. If only one argument is given, it will be the maximum. ##### File ```typescript import { NgRandomPipeModule } from 'angular-pipes'; ``` ##### Usage ```html {{ {} | random: 0: 1 }} {{ {} | random: 0: 10 }} {{ {} | random: 10 }} ``` #### sqrt Returns the square root of a number. ##### File ```typescript import { NgSqrtPipeModule } from 'angular-pipes'; ``` ##### Usage ```html {{ 81 | sqrt }} ``` #### pow Returns the power of a number. ##### File ```typescript import { NgPowPipeModule } from 'angular-pipes'; ``` ##### Usage ```html {{ 2 | pow }} {{ 2 | pow: 3 }} ``` #### abs Returns the absolute of a number. ##### File ```typescript import { NgAbsPipeModule } from 'angular-pipes'; ``` ##### Usage ```html {{ -2 | abs }} ``` #### ordinal Returns the number with a suffix indicating the ordinal. ##### File ```typescript import { NgOrdinalPipeModule } from 'angular-pipes'; ``` ##### Usage ```html {{ 1 | ordinal }} {{ 523 | ordinal }} {{ 15 | ordinal }} ```