 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Nik Guest
|
Posted: Wed Mar 08, 2006 4:03 am Post subject: Working with Currency |
|
|
Hi guys,
I'm running Delphi 7 along with Microsoft SQL2005 Express Edition. My
problem is I am attempting to push 9.991234 AsCurrency into a Money Field.
However, I would only like to use the first 2 decimal points, hence 9.99.
Can someone guide me on how to eliminate the other digits.
Thanks
Nik |
|
| Back to top |
|
 |
helmut woess Guest
|
Posted: Wed Mar 08, 2006 8:03 am Post subject: Re: Working with Currency |
|
|
Am Tue, 7 Mar 2006 23:26:47 -0400 schrieb Nik:
| Quote: | Hi guys,
I'm running Delphi 7 along with Microsoft SQL2005 Express Edition. My
problem is I am attempting to push 9.991234 AsCurrency into a Money Field.
However, I would only like to use the first 2 decimal points, hence 9.99.
Can someone guide me on how to eliminate the other digits.
Thanks
Nik
|
MONEY has always 4 digits! If you want exactly 2 digits use DECIMAL(9,2)
instead.
bye, Helmut |
|
| Back to top |
|
 |
John Herbster Guest
|
Posted: Wed Mar 08, 2006 1:03 pm Post subject: Re: Working with Currency |
|
|
"Nik" <nik (AT) nik (DOT) com> wrote
| Quote: | problem is I am attempting to push 9.991234
AsCurrency into a Money Field. However, I would
only like to use the first 2 decimal points, hence 9.99.
Can someone guide me ,,,
|
Nik,
Since you mention starting with a number like
9.991234, I presume that means a single, double,
or extended type var. If that is the case, you should
be using something like one of the decimal rounding
routines from my Decimal Rounding JH1 module,
which is freely available from CodeCentral
http://codecentral.borland.com/Item.aspx?id=21909
These routines allow you to select from about 9
different ways to manage the rounding of the extra
digits into your two, in preparation for assigning to
the field's AsCurrency property.
Regards, JohnH |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|