Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking first two digits of a number

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
Hi,

I want to be able to affirm that the first two digits of an 8-digit number are equal to 01. I'm familiar with achieving this when manipulating strings but not with numbers - could I use some kind of integer division function that returns just the integer part of the result e.g. in another programming language I would do
Code:
anumber div 100
and it returns the integer part of the result

Clive [infinity]
 
Hi.
Convert the number to character and then check:
Code:
to_char(anumber,'fm00000000')
or if you need the most right digits:
Code:
mod(anumber,100)

Stefan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top