Skip to content

netbrick/numeric_nation_input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Numeric Nation Input Gem for Rails 3.2

Build Status Gem Version

Info

Allow , and as decimal part delimiter for AR's float typecasting from string.

Installation

# Gemfile
gem "numeric_nation_input"

Usage

class TestModel < ActiveRecord::Base
  attr_accessible :attr1, :attr2

  numeric_nation_input :attr1, :attr2
end

model = TestModel.new(attr1: "1 025,45")
model.attr1 #=> 1025.45 (Float)

About

Numeric nation input gem - from "1 000,123" to "1000.123"

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages