search for: number_with_delimit

Displaying 8 results from an estimated 8 matches for "number_with_delimit".

Did you mean: number_with_delimiter
2009 Sep 09
5
Newbie question: undefined method 'number_with_delimiter'(probably configuration problem)
...HOME/gems/bin:$HOME/ruby/bin: and: $ locate number_helper.rb /home/lobatt/gems/gems/actionpack-2.3.3/lib/action_view/helpers/ number_helper.rb and i didn''t modify the file under config dir except database.yml. Isn''t actionpack included in rails projects by default? how can i get number_with_delimiter() work? Thanks in advance.
2007 May 12
4
Multiply and format with thousands separator
I have just started with Ruby and Rails and am still greatly confuse, finding the usual tutorials not much help. What I want to do is take two numbers from my database, multiply them together and display them in a list with a comma for the thousands separator. This would be very easy to do in a spreadsheet, so I assumed it would be easy to do in Ruby on Rails but I can''t work out how. I
2006 Jan 24
7
formatting numbers with commas
I needed to format numbers with commas to make it more human readable. Here''s how I did it. def commify(number) c = { :value => "", :length => 0 } r = number.to_s.reverse.split("").inject(c) do |t, e| iv, il = t[:value], t[:length] iv += '','' if il % 3 == 0 && il != 0 { :value => iv + e, :length =>
2009 Sep 30
2
What is this view syntax? Old beast forum code...
...ction of our site was closed off (simply by not linking to it anywhere). I''ve been tasked with resurrecting it, and the first problem i''m seeing is code like this in the views: <%= ''{count} topic(s)''[(count=Topic.count)==1 ? :topic_count : :topics_count, number_with_delimiter(count)] %>, or <%= submit_tag ''Save Forum''[:save_forum], :or => link_to(''Cancel''[:cancel], forums_path) %> My first thought was "wtf is that?", and it''s that question that i put to you, dear readers. max -- Posted via http://...
2008 Feb 20
1
text_field_tag - different parameter name
...ts. This view look like this: <% for product in @category.products %> <div class="produktyBox"> <%= product.title %><br /> Price: <br /> <div style="color:red; font-size:large; font-weight:bold; margin- bottom:5px"><%= number_with_delimiter(product.price, " ")%> Kč</ div> <%= link_to "Details", {:action => "product", :id => product.name_seo} %> <% form_tag :action => "add_to_cart" do %> <p> <%= text_field_tag :quantit...
2007 Dec 06
3
number_to_currency
...uot;unit") { "£" }, options.delete("separator") { "." }, options.delete("delimiter") { "," } separator = "" unless precision > 0 begin parts = number_with_precision(number, precision).split(''.'') unit + number_with_delimiter(parts[0], delimiter) + separator + parts[1].to_s rescue number end end it definately should work, but why doesnt the £ sign come as a question mark I have also tryed: def number_to_currency_gbp (number) number_to_currency(number, { :unit => "&pound;"})...
2006 Feb 28
4
number_to_currency UK pounds
I work in the UK and therefore most of my currency figures will be in UK pounds. I realise that to format a number to a currency format I can use: number_to_currency(amt, :unit => "?") but it would be more convenient to set ? as the default currency symbol. What is the best way to do that? Should I edit line 39 of this file:
2006 Feb 21
4
displaying double digits
Hi, I have a question about displaying digits in Rails. whenever I print the price of an item, if the last digit is a zero or double zeros then it doesn''t display properly. How do I display a number so that it looks like currency? thank you! -- Posted via http://www.ruby-forum.com/.