Hi guys, I want to insert data(integer OR decimal) into database record.
should the data structure be integer? if so how do I print the value I
enter (12.75 or 3)? thanks in advance.

Recommended Answers

All 2 Replies

Member Avatar for diafol

How on earth are we supposed to know which is right for you? You know the data you need to store and which datatype you should use. If you are storing integers and floats in the same field, then decimal would be the way to go. It will ensure all stored values are decimal (float).

Use a float or double; changes are that it will store full values (3, 6, 9, 10, 11, 13) with a .00 appended to it; but you should be able to just do a quick replacement in code for that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.