rails convert string to number
- by Yang
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!