|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
[Note: parts of this message were removed to make it a legal post.]
Hey there all, This should be simple. I need to know how to force a decimal place. say i wanted to do 3.5.to_s but i need that to be 3.50 as the string, how would i do this? thanks |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
> say i wanted to do 3.5.to_s
> but i need that to be 3.50 as the string, Use String#% and friends: "%.2f" % 3.5 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
[Note: parts of this message were removed to make it a legal post.]
cool, thanks much ! On Fri, Jun 20, 2008 at 1:38 PM, ThoML <micathom@gmail.com> wrote: > > say i wanted to do 3.5.to_s > > but i need that to be 3.50 as the string, > > Use String#% and friends: > > "%.2f" % 3.5 > > |
|
![]() |
| Outils de la discussion | |
|
|