float round

I

Igor Anic

Sorry for the stupid question, but I colud not find the method to round=20
float to the specific number of decimal places.

(1.234).method =3D 1.23

do I really had to write that by hand.

Thanks,
Igor

--=20
Igor Ani=E6
email: (e-mail address removed)
gsm: +385 91 53 90 849
42
www.4dva.hr
I. Lu=E8i=E6a 5, Zagreb
tel: +385 1 61 68 552
 
R

Robert Klemme

Igor said:
Sorry for the stupid question, but I colud not find the method to
round float to the specific number of decimal places.

(1.234).method = 1.23

do I really had to write that by hand.

Several options off the top of my head:
=> 1.23

Kind regards

robert
 
I

Igor Anic

Works great,
Thank you.
Facets has round_to and round_at.

T.




=20

--=20
Igor Ani=C4=87
email: (e-mail address removed)
gsm: +385 91 53 90 849
42
www.4dva.hr
I. Lu=C4=8Di=C4=87a 5, Zagreb
tel: +385 1 61 68 552
 
N

NBarnes

In other words, Ruby doesn't support that function without extension.=20
I rolled my own when I found I needed it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,188
Messages
2,571,002
Members
47,591
Latest member
WoodrowBut

Latest Threads

Top