2件ヒット
[1-2件を表示]
(0.013秒)
別のキーワード
ライブラリ
- ビルトイン (1)
-
rexml
/ document (1)
キーワード
- Numeric (1)
- Transitive (1)
検索結果
-
REXML
:: Formatters :: Transitive (148.0) -
XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。
XMLドキュメントをテキストの内容を変えずに
多少の整形を加えて出力するクラスです。
これが有用な場合はあまりないでしょう。
整形されていない XML を整形したいが、
テキストの空白は改行は変えたくない場合には役にたつかもしれません。
ただ、ほとんどの場合は奇妙な出力結果になるでしょう。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/transitive'
doc = REXML::Document.new <<EOS
<root><children>
<grandchildren foo='ba... -
Numeric (22.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...d
//}
また、任意桁の切上げ、切捨て、四捨五入を行うメソッドは以下のように
定義できます。
//emlist[][ruby]{
class Numeric
def roundup(d=0)
x = 10**d
if self > 0
self.quo(x).ceil * x
else
self.quo(x).floor * x
end
end
def roun...