30,997
edits
mNo edit summary Tag: 2017 source edit |
mNo edit summary Tag: 2017 source edit |
||
| Line 287: | Line 287: | ||
Example: | Example: | ||
< | <syntaxHighlight lang="sql"> | ||
Good: INSERT INTO table_1 (field_txt, field_num) VALUES ('txt', 412.62) | Good: INSERT INTO table_1 (field_txt, field_num) VALUES ('txt', 412.62) | ||
Bad: INSERT INTO table_1 (field_txt, field_num) VALUES ('txt', '412.62') | Bad: INSERT INTO table_1 (field_txt, field_num) VALUES ('txt', '412.62') | ||
</ | </syntaxHighlight> | ||
Note, problem of float numbers is same problem on all langauges and not only when inserting data into database. It occurs also with any language when you work on "real" numbers, so numbers must be, as soon as they are affected, cleaned with function price2num with second parameter defined to : | Note, problem of float numbers is same problem on all langauges and not only when inserting data into database. It occurs also with any language when you work on "real" numbers, so numbers must be, as soon as they are affected, cleaned with function price2num with second parameter defined to : | ||