Sass Number Functions

Last Updated:

Sass Number Functions

The following are the list of inbuilt number functions available in Sass language.

FunctionsExplanation
abs() Returns the absolute value of a number.
ceil() Returns the round of a number up to the next highest whole number.
comparable() Returns a Boolean value indicates whether number1 and number2 have compatible units.
floor() Returns the round of a number up to the next lowest whole number.
max() Returns the highest of one or more numbers. A list of numbers can be passed using ... (three dots).
min() Returns the lowest of one or more numbers. A list of numbers can be passed using ... (three dots).
percentage() Converts a unitless number to a percentage.
random() Returns a random decimal number between 0 and 1.
round() Returns the round of a number up to the nearest whole number.
unit() Returns a string representation of a number's units.
unitless() Returns whether a given number has a unit.

Share this Page

Meet the Author