What is the logic behind the trunc function?

Asked

Viewed 5,770 times

3

What does the trunc to be sure and what other uses may have taking this example?

TABELA EXERCICIO RESOLUÇAO

1 answer

4


To TRUNC() just discard the decimal part and keep the whole part.

In this case it doesn’t matter to see something like "2.75". With the function would be only "2 years", which is debatable because it is more to 3 years than 2. So the ROUND() might be more interesting.

  • Much simpler than I expected =)) already makes sense, thank you

  • I understand that the ROUND( ) can also be applied but the question asks for shows how many years ago was edited, so "2,75 years" are 2 years, if I am not mistaken with the ROUND( ) would result 3 years

  • @Droopy so I said it’s debatable, it depends on the criteria

Browser other questions tagged

You are not signed in. Login or sign up in order to post.