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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting to 3 digits beyond decimal point in chart - not working!!!!!

Status
Not open for further replies.

lmn

Programmer
Apr 3, 2003
60
US
Hello - I have a chart in a report. I've changed the query - updated the chart and I have specified I want a # with 3 decimal points (sometimes it is that close in rankings). The darned report gives me 3 post decimal numbers for every number but one. This one wants to be 57.906667. The client wants this fixed and I've explained I've tried everything under the sun! :)

The source for this number is the result of a query and not from a table.

Has this happened to anyon else???
 
yes. charts are horrible when dealing with this kind of thing. sometimes i even have to convert my numbers to strings to make it display the way i want it to:

cstr(" "&format([Number],"#.000") which is crazy but that's what i've come up with.

another way: try in your query instead of 'formatting' to force the issue another way. this rounds your calculated field in the query to three decimal places and this is how it will be displayed in the chart. substitute 'Expression' with your query expression.

(Int((([Expression])+0.0005)*1000))/1000

so for example:

57.906667 + .0005 = 57.907167
*1000= 57907.167
int(of that) = 57907 (int removes everything right of dec)
/1000 = 57.907

is rounding ok for you? if not, maybe you can tweak yourself if you just want it unrounded.

hope this helps.
g
 
worked like a charm....

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top