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!

On 2013-Nov-18, at 20:22 , Yinwen X. [email protected] wrote:

Thanks!

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

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

-Rob

Thank you Rob!

This post has a pure-ruby solution:

http://stackoverflow.com/questions/1078347/is-there-a-rails-trick-to-adding-commas-to-large-numbers

Thank you Michael

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs