Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report Formula

Status
Not open for further replies.

computerman29651

IS-IT--Management
Aug 28, 2006
51
US
I am trying to create formula to produce three significant figures. The formula I have come up with thus far is as follow:

ROUND(val({FLATDATA.ACOM}),2-(1+INT(ABS(val({FLATDATA.ACOM})))))

However, when I try to view the report, I get the error message "The number of decimal places is too large or not an integer."

Has anyone ever seen this error message or have an idea how to correct the problem?
 
What are you trying to do with this formula?

Please also show some sample data and then show how you want the display.

-LB
 
whileprintingrecords
global flow as double
local x as double
local result as double

if trim({FLATDATA.ACOM})="< RDL" then
result=val({FLATDATA.AMDL})
elseif {FLATDATA.ACOM} <> "< RDL" then
result=val({FLATDATA.ACOM})
end if
if trim({FLATDATA.AUNT})="ug/l" then
result=result/1000
end if
x=result*8.43*flow
formula = ????

Once this codes has ran, I want to set the result to three significant figures.
 
Please show some sample data and how you would like it to look. I don't know what you mean by "three significant figures".

-LB
 
If you take 25600/1000000*8.34*266, you get the answer 56.79206. I want only 56.8 to display on the report.

If you take 25600/1000000*8.34*.11, you get the answer 0.02349. I want only .0235 to display on the report.

The three significant figure in problem one would be '56.8' and the three significant figures in problem two wouls be the '.235'

What I am trying to do is display the first three real numbers, not including the zeros.

Does this better explain what I am trying to accomplish?
 
ok so you just did the math right?
25600/1000000*8.34*266

In your SPROC, declare and turn it into a variable...
dude = "25600/1000000*8.34*266"

Round off dude in the formula editor...
ROUND({usp.Report_HardMathDone;1.count_dude})

walla!
 
How about a few more examples? What would you want the following to look like:

500.001002

Ignoring the zeros is not at all intuitive.

-LB
 
Another example:

24360/1000000*8.34*.0002 = .00000009067248

54360/1000000*8.34*15/1000 = .006800436

I would want the 500.001002 to become 500
 
I am not real sure how to do the following:

ROUND({usp.Report_HardMathDone;1.count_dude})

What is the SPROC?
 
Well, what would you wanwt your new examples to look like?

-LB
 
Example 1: .00000009067248 = .0000000907

Example 2: .006800436 = .00680
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top