Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

rails format number k - m

# In views
number_to_human(1200, :format => '%n%u', :units => { :thousand => 'K' })

# In a controller
ActionController::Base.helpers.number_to_human(number, :format => '%n%u', :units => { :thousand => 'K' })
 
PREVIOUS NEXT
Tagged: #rails #format #number
ADD COMMENT
Topic
Name
9+9 =