Open Side Menu Go to the Top
Register
what does TRUNC mean what does TRUNC mean

04-08-2016 , 11:15 PM
I googled and all I received was

The TRUNC (number) function returns n1 truncated to n2 decimal places. If n2 is omitted, then n1 is truncated to 0 places. n2 can be negative to truncate (make zero) n2 digits left of the decimal point.

any help appreciated
what does TRUNC mean Quote
04-08-2016 , 11:16 PM
just found this

https://en.wikipedia.org/wiki/Truncate_(SQL)

still pretty clueless.. i dont write in SQL
what does TRUNC mean Quote
04-09-2016 , 12:08 AM
Typically, truncate means to reduce in size. Imagine you have a string of length 20 and you truncate it to a string of length 10. The last 10 characters in that case would be removed. It's probably something very similar in sql queries.
what does TRUNC mean Quote
04-09-2016 , 02:07 AM
543.21, truncate the decimals (default) and you get 543. Truncate by negative one and you get 540. Negative two is 500. Positive one is 543.2 I think.
what does TRUNC mean Quote
04-09-2016 , 01:39 PM
Truncate to n decimal places simply means "cut off" after that many places.

TRUNC(2.7689, 2) -> 2.76
TRUNC(2.7689, 3) -> 2.768
TRUNC(2.7689) -> 2
TRUNC(2.7689, -1) -> probably 0.7689 but that isn't 100% clear from the docs imo
what does TRUNC mean Quote

      
m