Board index » delphi » Limit the number of decimal digits in Money Field

Limit the number of decimal digits in Money Field

Have a look at the BDE control panel, the configuration page, and numeric
formats for decimal places.

Regards,
Greg

"Jos Carlos Marcusso Jr" <qinformat...@uol.com.br> wrote in message
news:3a2262ac_1@dnews...

Quote
> Hi all!

> I'm using Paradox 7 with BDE 5.1.1.

> I have a table with a Money field. When a make some processing the value
of
> this field bacame with 4 decimal digits. But I can't let the field with
> these 4 digits. How can I avoid this case?

> My processing is a SQL UPDATE that modifies the field (based in some
> percentage, because of this the result  may be with 4 decimal digits).

> I tried to CAST the value in the UPDATE statement but it didn't work.

> Any ideas?

> Thanks

> Jose Carlos
> Brazil

 

Re:Limit the number of decimal digits in Money Field


Hi all!

I'm using Paradox 7 with BDE 5.1.1.

I have a table with a Money field. When a make some processing the value of
this field bacame with 4 decimal digits. But I can't let the field with
these 4 digits. How can I avoid this case?

My processing is a SQL UPDATE that modifies the field (based in some
percentage, because of this the result  may be with 4 decimal digits).
I tried to CAST the value in the UPDATE statement but it didn't work.

Any ideas?

Thanks

Jose Carlos
Brazil

Re:Limit the number of decimal digits in Money Field


One problem you may run into, depending on which database format you are
ultimately using, is the numeric-precision problem.  Exactly how many
digits of precision are stored and in what format.

For instance:  MS-Access stores Money as a scaled integer; the value is
multiplied by 10,000 and stored as an integer.  Paradox uses ordinary
floating-point.

Quote
>Jos Carlos Marcusso Jr wrote:

> Hi all!

> I'm using Paradox 7 with BDE 5.1.1.

> I have a table with a Money field. When a make some processing the value of
> this field bacame with 4 decimal digits. But I can't let the field with
> these 4 digits. How can I avoid this case?

> My processing is a SQL UPDATE that modifies the field (based in some
> percentage, because of this the result  may be with 4 decimal digits).
> I tried to CAST the value in the UPDATE statement but it didn't work.

> Any ideas?

------------------------------------------------------------------
Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259
mailto:i...@sundialservices.com  (PGP public key available.)
Quote
> Fast(!), automatic table-repair with two clicks of the mouse!
> ChimneySweep(R):  "Click click, it's fixed!" {tm}
> http://www.sundialservices.com/products/chimneysweep

Re:Limit the number of decimal digits in Money Field


"Jos Carlos Marcusso Jr" <qinformat...@uol.com.br> schrieb im Newsbeitrag
news:3a2262ac_1@dnews...

Quote
> Hi all!

> I'm using Paradox 7 with BDE 5.1.1.

> I have a table with a Money field. When a make some processing the value
of
> this field bacame with 4 decimal digits. But I can't let the field with
> these 4 digits. How can I avoid this case?

> My processing is a SQL UPDATE that modifies the field (based in some
> percentage, because of this the result  may be with 4 decimal digits).

> I tried to CAST the value in the UPDATE statement but it didn't work.

> Any ideas?

> Thanks

> Jose Carlos
> Brazil

try this:
cast(GR_RAP*100 + 0.5 as integer) / 100.0

perhaps it works how do you want

Hans

Other Threads