/normalize_numbers

Allow use of comma for Rails model attributes without loosing decimal part

Primary LanguageRubyMIT LicenseMIT

Build Status

NormalizeNumbers

Simple solution for Rails to allow numbers with decimal point to be assigned both with , (comma) and . (dot), without loosing decimal part.

'10,5'.to_f
# 10.0

Installation

Gemfile:

gem 'normalize_rails', git: 'git@github.com:vladra/normalize_numbers.git'

Usage

class Model < ActiveRecord::Base
  normalize_numbers :price, :tax
end

License

The gem is available as open source under the terms of the MIT License.