Skip to content

Commit 2fd9192

Browse files
committed
整理完算数函数
1 parent 05b0235 commit 2fd9192

1 file changed

Lines changed: 39 additions & 75 deletions

File tree

source/docs/reference.md

Lines changed: 39 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -237,74 +237,87 @@
237237

238238
### 算数函数 (Math functions)
239239

240-
ceil(@number)
240+
#### ceil
241241

242242
向上取整。
243243

244-
参数:
244+
参数
245245

246-
@number: 浮点数 (A floating point number.)
247-
返回值:整数 (integer)
246+
- 数字:浮点数
247+
248+
返回值:向上取整后的整数
248249

249250
例如:
250251

251-
ceil(2.4)
252+
ceil(2.4)
253+
252254
输出:
253255

254-
3
255-
floor(@number)
256+
3
257+
258+
#### floor
256259

257260
向下取整。
258261

259-
参数:
262+
参数
260263

261-
@number: 浮点数 (A floating point number.)
262-
返回值:整数 (integer)
264+
- 数字:浮点数
265+
- 返回值:向下取整后的整数
263266

264267
例如:
265268

266-
floor(2.6)
269+
floor(2.6)
270+
267271
输出:
268272

269-
2
270-
percentage(@number)
273+
2
274+
275+
#### percentage
271276

272-
将浮点数 (A floating point number) 转换为百分比字符串 (percentage string)
277+
将浮点数转换为百分比字符串
273278

274279
参数:
275280

276-
@number: 浮点数 (A floating point number.)
277-
返回值:字符串 (string)
281+
- 数字:浮点数
282+
283+
返回值:字符串
278284

279285
例如:
280286

281-
percentage(0.5)
287+
percentage(0.5)
288+
282289
输出:
283290

284-
50%
285-
round(number, [places: 0])
291+
50%
292+
293+
#### round(number, [places: 0])
286294

287295
四舍五入取整。
288296

289297
参数:
290298

291-
@number: 浮点数 (A floating point number.)
292-
@decimalPlaces: 可选:四舍五入取整的小数点位置,默认值 0。
299+
- 数字:浮点数
300+
- 小数位数:数字,可选,四舍五入取整的小数点位置,默认值为0。
301+
293302
返回值:数字 (number)
294303

295304
例如:
296305

297-
round(1.67)
306+
round(1.67)
307+
298308
输出:
299309

300-
2
310+
2
311+
301312
例如:
302313

303-
round(1.67, 1)
314+
round(1.67, 1)
315+
304316
输出:
305317

306-
1.7
307-
颜色函数 (Color functions)
318+
1.7
319+
320+
### 颜色函数 (Color functions)
308321

309322
颜色解释 (Color definition)
310323

@@ -1117,55 +1130,6 @@ Color 1 Color 2 Color 3
11171130

11181131

11191132

1120-
Math functions
1121-
1122-
ceil
1123-
1124-
Rounds up to the next highest integer.
1125-
1126-
Parameters:
1127-
1128-
number: A floating point number.
1129-
Returns: integer
1130-
1131-
Example:
1132-
1133-
ceil(2.4)
1134-
Output:
1135-
1136-
3
1137-
floor
1138-
1139-
Rounds down to the next lowest integer.
1140-
1141-
Parameters:
1142-
1143-
number: A floating point number.
1144-
Returns: integer
1145-
1146-
Example:
1147-
1148-
floor(2.6)
1149-
Output:
1150-
1151-
2
1152-
percentage
1153-
1154-
Converts a floating point number into a percentage string.
1155-
1156-
Parameters:
1157-
1158-
number: A floating point number.
1159-
Returns: string
1160-
1161-
Example:
1162-
1163-
percentage(0.5)
1164-
Output:
1165-
1166-
50%
1167-
round
1168-
11691133
Applies rounding.
11701134

11711135
Parameters:

0 commit comments

Comments
 (0)