13.10. Sass digital function

Release time : 2024-02-28 23:00:06 UTC      

The Sass numeric function is used to process some numeric values.

The following table lists the numeric functions of Sass:

Function

Description & example

abs(number)

Returns the absolute value of a numeric value.

Example: abs (15) result: 15 abs (- 15) result: 15

ceil(number)

Rounding up

Example: ceil. Result: 16.

comparable(num1, num2)

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

floor(number)

Round down

Example: floor (15.80) result: 15

max(number...)

Return the maximum value

Example: max (5, 7, 9, 0,-3,-7) result: 9

min(number...)

Return to the minimum

Example: min (5,7,9,0,-3,-7) result:-7

percentage(number)

Convert a number into an expression of a percentage.

Example: percentage (1.2) result: 120

random()

Returns the decimal within the 0-1 interval

Example: random () result: 0.45673

random(number)

Returns an integer between 1 and number, including 1 and limit.

Example: random (6) result: 4

round(number)

Returns the integer closest to that number, rounded.

Example: round. Result: 15 round. Result: 16.

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.