Decimal Integer cant be inserted to db via form

I have form to insert rows to database. All created in gii (model & crud). Its simple table (id INT, name text, quantity INT)

When i try insert via form quantity 1,41 (or 1.41) - I always have answer “FIELD must be an integer” and i can’t insert this…

What im doing wrong?

Yii 1.1.5 & sqlite3

(sry for my English)

I don’t understand? Use DECIMAL type and modify corresponding model’s rules.

THANKS for quick answer andy_s :)

Where should I use DECIMAL?

In sql table?? or in Model?

All I need is save in table integers like 1.41 or 15.10


change the field in database to DECIMAL or FLOAT (alter table …)

change the model rule to NUMERICAL ( array(‘quantity’,‘numerical’) )

THANK YOU VERY MUCH Flavio & andy_s

DECIMAL in sql table do THE JOB

Its sqlite3 so I’m surprised for decimal type but it works.

thanks again ;)


1.5 is not an integer.

It’s a floating point value / decimal number.

Integers are whole numbers. :)

Right Viking ;)

INTEGER worked for me as floating point v./decimal in sqlite3 & simply php programing before i work with Yii

… bad habit


I am used to languages with strict type-checking, like C++. ;)