Re: number format to 2 decimals
- From: "ypul" <ypul@xxxxxxxxxxx>
- Date: Wed, 10 Aug 2005 09:28:50 +0100
Thanks Buddy
that was very very ......helpful !!
ypul
"David Gugick" <david.gugick-nospam@xxxxxxxxx> wrote in message
news:e8NGR%23SnFHA.2860@xxxxxxxxxxxxxxxxxxxxxxx
> ypul wrote:
> > numericcolumn datatype is float
> >
> > ypul
> >
>
> Probably using the wrong data type. Why have you chosen to use an
> approximate data type like float/real instead of DECIMAL/NUMERIC which
> stores an exact represenation of a number? Do you really need to store.
> From BOL:
>
> "Approximate number data types for use with floating point numeric data.
> Floating point data is approximate; not all values in the data type
> range can be precisely represented."
>
> If you either must use a float or cannot change the data type to
> something more appropriate, you have two options:
> 1- Format the numeric data on the client - client formatting is
> preferred over using SQL Server to do the same
> 2- Use the CAST function, but you may have to deal with rounding issues
>
> For example:
>
> Declare @f real
> Set @f = .05
> Select @f -- Returns 5.5500001E-2
> Select CAST(@f as NUMERIC(10, 2)) -- Returns .06
>
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>
.
- References:
- number format to 2 decimals
- From: ypul
- Re: number format to 2 decimals
- From: David Gugick
- Re: number format to 2 decimals
- From: ypul
- Re: number format to 2 decimals
- From: David Gugick
- number format to 2 decimals
- Prev by Date: Re: Can't connect to Access project
- Next by Date: problem deploying access project
- Previous by thread: Re: number format to 2 decimals
- Next by thread: problem deploying access project
- Index(es):
Relevant Pages
|