rails convert string to number

Posted by Yang on Stack Overflow See other posts from Stack Overflow or by Yang
Published on 2010-05-06T02:38:31Z Indexed on 2010/05/06 2:48 UTC
Read the original article Hit count: 290

Filed under:
|

hi guys,

i am wondering is there a convenient function in rails to convert string with negative signs into a number. e.g. -1005.32

when i use to_f method, the number will simply become 1005 with the negative sign and decimal part being ignored.

thanks in advance!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby