I have a business model with a decimal field. Its value must be between 0.00 and 999.99. So I have created a decimal field and add validations to the model.

```
class Order < ApplicationRecord

  validates :price, format: { with: /\A\d+(?:\.\d{0,2})?\z/ }, numericality: { greater_than: 0, less_than: 1000 }

end

```

When I create the Order object with a decimal value which is greater than 1000 or less than 0, I get the error I expected and that's ok. I can see that 
"numericality: { greater\_than: 0, less\_than: 1000 }" validations work as expected. 

Howeber, when I try to create an Order object with a decimal value of 45.45554 or 45.45666, rails persists the object to the database with the price value of 45.45. I expect getting a format error, but it seems that
format validation doesn't work.

What I'm doing wrong ?

Any suggestions,

Thanks.