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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncate Decimals

Status
Not open for further replies.

yu217171

Programmer
Joined
Aug 2, 2002
Messages
203
Location
CA
Hi everyone,

I'm having a small problem with truncating decimals values. I have a field that's of type real. I would like to truncate values 12.99383 to 12.99

I tried using the round function (select round(12.99383, 2)) but that returns 12.99000, which doesn't truncate the field value.

Thanks in advance,

Keith
 
Real data type by definition has 7 digits. You will need to use cast or convert to change to a decimal data type. IF you only want 2 digits, why are you storing it as real which is an approximate data type? Why not store the information as decimal to begin with?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top