Ruby script delimiter a number

Hi, here is my ruby script displaying the land area:
<%= property.land_area_sqm -%>
I want to delimiter the number to a format with comma

like 10000000 -->10,000,000

I have tried this but not working:
property.land_area_sqm, :precision => 0, :delimiter => ','

any one can help me make it work please

Thanks!

···

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

Perhaps this is Rails? It's certainly at least ERb

http://apidock.com/rails/ActionView/Helpers/NumberHelper/number_with_precision

-Rob

···

On 2013-Nov-18, at 20:22 , Yinwen X. <lists@ruby-forum.com> wrote:

Hi, here is my ruby script displaying the land area:
<%= property.land_area_sqm -%>
I want to delimiter the number to a format with comma

like 10000000 -->10,000,000

I have tried this but not working:
property.land_area_sqm, :precision => 0, :delimiter => ','

any one can help me make it work please

Thanks!

This post has a pure-ruby solution:

···

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

Thank you Rob!

···

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

Thank you Michael

···

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