Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby nil to float is 0.00

irb(main):001:0> nil.to_i
=> 0
irb(main):002:0> nil&.to_i
=> nil
irb(main):003:0> nil.to_f
=> 0.0
irb(main):004:0> nil&.to_f
=> nil
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #ruby #nil #float
ADD COMMENT
Topic
Name
1+7 =