2 つの値の商を整数値に切り捨てたものと、対応する端数を計算します。最も簡単な形式では、単に値を切り捨てます。
シグネチャ
戻り値
説明
例
| 例: 多様な値と truncate の使用 | |
![]() | |
{text
{br} {truncate 3.9}
{br} {truncate 3.5}
{br} {truncate 3.1}
{br} {truncate -3.1}
{br} {truncate -3.5}
{br} {truncate -3.9}
{br} {truncate 8.1, 2}
{br} {truncate 8.1m, 2m}
{br} {truncate 3hours, 7minutes}
{br} {truncate 12cm, 6cm}
{br} {value {truncate 12cm / 1cm, 6} * 1cm}
}
|| using truncate with quantities
{value
|| Convert a height in meters to feet and inches
let height:Distance = 2.0meters
let (feet:double, inches:Distance) = {truncate height, 1ft}
{text {br}In {value height} there are {value feet} feet
and {format "%.1f", inches/1in} inches.}
}
|