Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1567
  • Last Modified:

Type Casting in oracle

How do u type cast in oracle.
I want to convert a decimal value into integer.In Access we have CINT.What is the equivallent in Oracle
0
SusanBinoy
Asked:
SusanBinoy
  • 2
1 Solution
 
grim_toasterCommented:
There are a number of ways to do this, th simplest of which are:

ceil(76.76)   - returns the smallest integer larger than (or equal) to the value passed (eg 77 in this case).
floor(76.76) - returns the smallest integer smaller than (or equal) to the value passed (eg 76 in this case).
round(76.76, 0) - rounds of the number to the specified precision (the second parameter) (eg 77 in this case).

0
 
grim_toasterCommented:
Or trunc(76.77, 0) - which truncates the value to the specified precision.
0
 
SusanBinoyAuthor Commented:
Thanks Grim that was a quick answer.
It is working I was searching for the answer for a long time
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now