Sass digital function
The Sass numeric function is used to process some numeric values.
The following table lists the numeric functions of Sass:
Function |
Description & example |
---|---|
|
Returns the absolute value of a numeric value. Example: abs (15) result: 15 abs (- 15) result: 15 |
|
Rounding up Example: ceil. Result: 16. |
|
Returns a Boolean value to determine whether num1 and num2 can be compared Example: comparable (15px, 10px) result: true comparable (20mm, 1cm) result: true comparable (35px, 2em) result: false |
|
Round down Example: floor (15.80) result: 15 |
|
Return the maximum value Example: max (5, 7, 9, 0,-3,-7) result: 9 |
|
Return to the minimum Example: min (5,7,9,0,-3,-7) result:-7 |
|
Convert a number into an expression of a percentage. Example: percentage (1.2) result: 120 |
|
Returns the decimal within the 0-1 interval Example: random () result: 0.45673 |
|
Returns an integer between 1 and number, including 1 and limit. Example: random (6) result: 4 |
|
Returns the integer closest to that number, rounded. Example: round. Result: 15 round. Result: 16. |