BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Working with Currency

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Nik
Guest





PostPosted: Wed Mar 08, 2006 4:03 am    Post subject: Working with Currency Reply with 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
Back to top
helmut woess
Guest





PostPosted: Wed Mar 08, 2006 8:03 am    Post subject: Re: Working with Currency Reply with quote



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





PostPosted: Wed Mar 08, 2006 1:03 pm    Post subject: Re: Working with Currency Reply with quote



"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.