[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Sybase and floating points. Help please!!!



Try this:

(convert(decimal(17,2), variable + .005))

Bob Smith



> -----Original Message-----
> From: Michael Berggren [SMTP:mjb@CONVOY.COM]
> Sent: Tuesday, February 24, 1998 2:58 PM
> To:   Multiple recipients of list SQR-USERS
> Subject:      Sybase and floating points. Help please!!!
>
> I am currently trying to read from a file and insert a numeric value
> into a
> PeopleSoft table on Sybase.  The value is a dollar amount and is
> already
> rounded off to two (2) decimal places in the file (i.e. 999.99).
> However,
> when SQR reads this value it rounds the value out to 15 decimal places
> making the value too long to be inserted into the column.
>
> We have already tried the following functions:  truncate, round, edit,
> and
> even parsing the value.  No matter what I do, whenever I do a 'show'
> statement, SQR is rounding the number out to 15 decimal places.
> Example:
>
>         Input:  203.80
>         Output:  203.799999999999900
>
> It is important to note that we are using SQR Version 3.2 for Sybase.
>
> Can anyone give me advice on how to stop SQR from rounding the number
> past
> 2 decimal places????
>
> Thanks,
>
> Mike Berggren
> mjb@convoy.com