Remove decimal point in crystal report formula

I have an ASP.NET VS 2008 project where I am using a formula in Crystal Reports to fill in a field.
The formula is as follows:
IIF(((CDbl ({Table1.WireDiameter})*CDbl({Table1.WireDiameter}))*0.785)=0,"",CStr ({Table1.Breakload}/((Cdbl({Table1.WireDiameter})*Cdbl({Table1.WireDiameter}))*0.785)))

How do I get this to round-up and lose the decimal?
Thanks!
ITMikeKAsked:
Who is Participating?
 
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Cstr(<your_expression> , 0)
0
 
ITMikeKAuthor Commented:
How would it work with this?

IIF((CDbl ({Table1.WireDiameter})*CDbl ({Table1.WireDiameter}))-(CDbl ({Table1.CupDiameter})*CDbl ({Table1.CupDiameter}))=0,"",CStr (((CDbl ({Table1.WireDiameter})*CDbl ({Table1.WireDiameter}))-(CDbl ({Table1.CupDiameter})*CDbl ({Table1.CupDiameter})))/(CDbl ({Table1.WireDiameter})*CDbl ({Table1.WireDiameter}))*100))
0
 
mlmccCommented:
CSTR(IIF((CDbl ({Table1.WireDiameter})*CDbl ({Table1.WireDiameter}))-(CDbl ({Table1.CupDiameter})*CDbl ({Table1.CupDiameter}))=0,"",CStr (((CDbl ({Table1.WireDiameter})*CDbl ({Table1.WireDiameter}))-(CDbl ({Table1.CupDiameter})*CDbl ({Table1.CupDiameter})))/(CDbl ({Table1.WireDiameter})*CDbl ({Table1.WireDiameter}))*100)) , 0)

mlmcc
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
I don't think that is the correct approach because the IIF expression already returns a string.  The CSTR 0 argument (requesting no decimals) should be applied to the inner numeric expression.  Something like this:

IIF((CDbl ({Table1.WireDiameter})*CDbl ({Table1.WireDiameter}))-(CDbl ({Table1.CupDiameter})*CDbl ({Table1.CupDiameter}))=0,"",CStr (((CDbl ({Table1.WireDiameter})*CDbl ({Table1.WireDiameter}))-(CDbl ({Table1.CupDiameter})*CDbl ({Table1.CupDiameter})))/(CDbl ({Table1.WireDiameter})*
CDbl ({Table1.WireDiameter}))*100), 0)
0
 
ITMikeKAuthor Commented:
I am getting an error "Too many arguments have been given to this function"
0
 
mlmccCommented:
Try it this way

IIF((CDbl ({Table1.WireDiameter})*CDbl ({Table1.WireDiameter}))-(CDbl ({Table1.CupDiameter})*CDbl ({Table1.CupDiameter}))=0,"",CStr (((CDbl ({Table1.WireDiameter})*CDbl ({Table1.WireDiameter}))-(CDbl ({Table1.CupDiameter})*CDbl ({Table1.CupDiameter})))/(CDbl ({Table1.WireDiameter})*
 CDbl ({Table1.WireDiameter}))*100, 0))

mlmcc
0
 
ITMikeKAuthor Commented:
That was it! Thanks for you help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.