Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Inquiry Post Reply Post New Topic
Author Message
reyzky
Newbie
Newbie
Avatar

Joined: 30 Apr 2009
Location: Philippines
Online Status: Offline
Posts: 2
Quote reyzky Replybullet Topic: Inquiry
     Posted: 30 Apr 2009 at 10:37am
Hi All!
I'm new with crystal report ver 11.
I have a formula :

ToText ({POPOPRN.OQOUTSTAND},ToNumber({?QTYDEC}) )
but this give a result say 2,000.000
I want to get rid of 3zeros after the decimal point.
Please Help.

Thanks a lot.


































































































































































































































IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Apr 2009 at 1:53pm
not sure what you are trying to do here...
ToText ({POPOPRN.OQOUTSTAND},ToNumber({?QTYDEC}) )
the "ToNumber({?QTYDEC})" portion is =3 which is giving you the 3 decimal places.
TOTEXT(field,#) changes a numeric field to text and inserts a total number of decimal where the # portion is the decimal places.
Are you trying to multiply OQOUTSTAND by ?QTYDEC or do something else here?
if multiplying it should be
totext({POPOPRN.OQOUTSTAND}*tonumber({?QTYDEC}),0)


Edited by DBlank - 30 Apr 2009 at 2:29pm
IP IP Logged
reyzky
Newbie
Newbie
Avatar

Joined: 30 Apr 2009
Location: Philippines
Online Status: Offline
Posts: 2
Quote reyzky Replybullet Posted: 01 May 2009 at 1:56pm
Hi!
Thanks for the reply

ToText ({POPOPRN.OQOUTSTAND},ToNumber({?QTYDEC}) )
POPOPRN.OQOUTSTAND coming from database field
QTYDEC             coming from parameter field

The above formula gives already a correct value except that the number has 3 zeros after the decimal point.
I want to change it into a whole number meaning no zero after the decimal point. I dont need to multiply n two.
thanks again.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 May 2009 at 3:00pm

In your formula all you are doing is changing the ({POPOPRN.OQOUTSTAND} field to text AND the ({?QTYDEC}) field is adding in the 3 zeros on the end of it. To get rid of the zeros use a zero instead of your parameter.

ToText ({POPOPRN.OQOUTSTAND},0)
 
What I could not figure out is why you used the parameter field at all. It looked like you wanted to use it to do a calculation against the OQOUTSTAND field, hence my other suggestion.
Hope this clears it up for you.


Edited by DBlank - 01 May 2009 at 3:08pm
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum