Sprachen und Programmierregeln: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
Tag: 2017 source edit
mNo edit summary
Tag: 2017 source edit
Line 287: Line 287:


Example:
Example:
<source lang="sql">
<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')
</source>
</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 :

Navigation menu