13.10. Sass digital function

发布时间 : 2025-10-25 13:35:45 UTC      

Page Views: 9 views

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.

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。