October 15th, 2013, 08:16 AM
Cutting down decimals
when working with decimals i know how to add the numer of decimals...i have to power it with a decimal
like integer * 1.000 = 3 decimal number
but now i have the inverse scenario:
in a formula i have a lot of 6 decimal numbers and the problem is that the result is too big and gives this error:
how can i cut down decimals?
here is the formula i use:
DIF_C, WARMDIF_C, ENERGY_C = NUMBER(15,6)
WARM_C = NUMBER(15.2)
October 17th, 2013, 09:48 AM
Try see the value in use, first! If N / 0 = error of course
if ( x < Type > x ) = error of cource
Try to use one procedure for test.
See the diferece between NUMERIC and DECIMAL type
REMEMBER: ANY calculation or other with NULL, ALWAYS is NULL resulted
n / NULL = NULL = error
Last edited by emailx45; October 17th, 2013 at 09:52 AM.
Further to what emailx45 wrote, if you just want to cut down the decimal count on a number you can cast the value as a numeric(x, y) with the y being the number of decimals.
So for example if you
cast(123.4567890 as numeric(5,2))
you would get