Afficher un message
Vieux 06/11/2007, 16h19   #2
Paulo Carvalho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: convert a string into a decimal

> a="100000000.00"
> a.to_f

=> 100000000.0


Ernst Tanaka wrote:
> I am a new Ruby programmer. I am really amazed with the ease of
> programming.
>
> I seem not to be able to find a solution for the following task.
>
> I want to convert an object with the class string into a object with the
> class fixnum or decimal. So I can store the result in a Decimal(13,2)
> sql field.
>
>
> The value of the object string is "100,000,000.00" (including the comma
> and the decimal point.
>
> Appreciate all the at for hand!
>
> Ernst


--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
 
Page generated in 0,05167 seconds with 9 queries