るりまサーチ

最速Rubyリファレンスマニュアル検索!
108件ヒット [101-108件を表示] (0.052秒)

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer chr
  5. integer rationalize

ライブラリ

クラス

キーワード

検索結果

<< < 1 2 >>

Float#truncate(ndigits = 0) -> Integer | Float (133.0)

小数点以下を切り捨てて値を整数に変換します。

...Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
1.234567.truncate(2) # => 1.23
34567.89.truncate(-2) # => 34500
//}

@see Numeric#round, Numeric#ce...
...il, Numeric#floor...

Float#to_i -> Integer (127.0)

小数点以下を切り捨てて値を整数に変換します。

...小数点以下を切り捨てて値を整数に変換します。


//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
//}

@see Numeric#round, Numeric#ceil, Numeric#floor...

Float#truncate -> Integer (127.0)

小数点以下を切り捨てて値を整数に変換します。

...小数点以下を切り捨てて値を整数に変換します。


//emlist[例][ruby]{
2.8.truncate # => 2
(-2.8).truncate # => -2
//}

@see Numeric#round, Numeric#ceil, Numeric#floor...
<< < 1 2 >>