るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.065秒)
トップページ > ライブラリ:ビルトイン[x] > バージョン:2.1.0[x] > クエリ:_builtin[x] > クエリ:float[x] > クエリ:at[x] > クラス:String[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

検索結果

String#to_f -> Float (24733.0)

文字列を 10 進数表現と解釈して、浮動小数点数 Float に変換します。

...# => Infinity
# warning: Float 10101010101010101010... out of range
//}

なお、このメソッドとは逆に、数値を文字列に変換するには
Kernel.#sprintf, String#%, Integer#to_s
を使用します。

@see String#hex, String#oct, String#to_i,
Kernel.#Integer, Kernel.#Float...