# to\_i$B$H(Bto\_f$B$N0l4S@-(B

**URL:** <https://www.ruby-forum.com/t/to-i-b-h-bto-f-b-n0l4s-b/140172>\
**Category:** Development\
**Created:** [June 11, 2008, 3:54pm UTC](https://www.ruby-forum.com/t/to-i-b-h-bto-f-b-n0l4s-b/140172 "2008-06-11T15:54:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 11, 2008, 3:54pm UTC](https://www.ruby-forum.com/t/to-i-b-h-bto-f-b-n0l4s-b/140172/1 "2008-06-11T15:54:07Z")

</div>

e$B$k$S$-$A$G$9!#e(B

String#to\_ie$B$He(BString#to\_fe$B$GO"B3$7$?e(B\_e$B$N07$$$K0c$$$,$"$j$^$9!#e(B

RUBY\_VERSION # =\> “1.9.0”  
[“+1\_1\_\_2”.to\_i, “+1\_1\_\_2”.to\_f] # =\> [11, 112.0]  
Integer("+1\_1\_\_2") rescue $! # =\> #\<ArgumentError: invalid value for  
Integer: “+1\_1\_\_2”\>  
Float("+1\_1\_\_2") rescue $! # =\> #\<ArgumentError: invalid value for  
Float(): “+1\_1\_\_2”\>
