M
Marcin Tyman
Hi,
How to truncate float number after dot? I suppose it would be easy.
Thank in advance
MT
How to truncate float number after dot? I suppose it would be easy.
Thank in advance
MT
Hi,
How to truncate float number after dot? I suppose it would be easy.
Thank in advance
Hi,
How to truncate float number after dot? I suppose it would be easy.
Thank in advance
MT
irb(main):001:0> 12.68.floor
=> 12
irb(main):002:0> 12.68.ceil
=> 13
Pat
2007/7/26 said:Gah, I forgot the all important round!
irb(main):003:0> 12.68.round
=> 13
irb(main):004:0> 12.38.round
=> 12
2007/7/26 said:I didn't mean to truncate all. But i.e. to round to several places after
dot.
Marcin said:How to truncate float number after dot? I suppose it would be easy.
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.