20 lines
473 B
Markdown
20 lines
473 B
Markdown
# 十进制
|
|
|
|
decimal128 数值的解析、格式化和舍入。
|
|
|
|
## decimal.round
|
|
|
|
就近舍入,中点取偶数;places 为负时舍入到十、百等位。精度或结果无法表示时产生数值故障。
|
|
|
|
## decimal.parse
|
|
|
|
解析有限且精确可表示的 Decimal128;格式非法或需要舍入时返回 null。
|
|
|
|
## decimal.toText
|
|
|
|
输出规范化 Decimal 文本,去除多余尾零,零统一写为 0。
|
|
|
|
## decimal.fromInt
|
|
|
|
把 Int 精确转换为 Decimal。
|