# Round

**URL:** <https://rubytalk.org/t/round/42579>\
**Category:** ruby-talk\
**Created:** [28 November 2007 17:15 UTC](https://rubytalk.org/t/round/42579 "2007-11-28T17:15:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bober](https://avatars.discourse-cdn.com/v4/letter/b/b5e925/32.png) [@Bober](https://rubytalk.org/u/Bober)\
**Post date:** [28 November 2007 17:15 UTC](https://rubytalk.org/t/round/42579/1 "2007-11-28T17:15:00Z")

</div>

Hello,  
In my application form db I become double,  
for example 10 =\> 10.00 or 10.2 =\> 10.20

id it possible?  
Is there any function in Rails to it?

---

<div class="post-metadata">

**Author:** ![Jose\_francisco\_Gonza](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Jose\_francisco\_Gonza](https://rubytalk.org/u/Jose_francisco_Gonza)\
**Post date:** [28 November 2007 18:25 UTC](https://rubytalk.org/t/round/42579/2 "2007-11-28T18:25:20Z")

</div>

Bober wrote:

> Hello,  
> In my application form db I become double,  
> for example 10 =\> 10.00 or 10.2 =\> 10.20
> 
> id it possible?  
> Is there any function in Rails to it?

Pure ruby:

puts "%02.02f" % 10  
puts "%02.02f" % 10.2

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
