mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-22 11:46:10 +08:00
12 lines
365 B
Ruby
12 lines
365 B
Ruby
describe "NSDecimal" do
|
|
it "can be created from NSDecimalNumber" do
|
|
dn = NSDecimalNumber.decimalNumberWithString('123.456')
|
|
d = dn.decimalValue
|
|
d.class.should == NSDecimal
|
|
NSDecimalNumber.decimalNumberWithDecimal(d).should == dn
|
|
ptr = Pointer.new(NSDecimal.type)
|
|
ptr[0] = d
|
|
NSDecimalString(ptr, nil).should == dn.stringValue
|
|
end
|
|
end
|