shapper said:
Hello,
What should be the data type for holding numbers with 2 decimal places
(2.32, 4.23, 1.23, ...)?
Thanks,
Miguel
That depends on what you are going to use them for.
Double is the most common data type for floating point numbers, and
generally gives the best performance.
If you have a lot of numbers, you can use Single. As it's smaller you
get better performance, as there is less data to move around.
If you need absolute precision, you can use Decimal. It's larger, but it
doesn't approximate the values as Single and Double does.
Another way yo get absolute precision is to represent the values as
integer values multiplied by hundred. An Int is good for nine digits. A
Short only manages four digits, but it's even smaller than a Singe, so
you can use that if you really need to save memory.