Check at http://www.cflib.org
Look in the MathLib for RoundIt to see if that's what you need. While you're
there, grab a copy of the Studio UDF Browser so you have direct access to
their stuff from within CF Studio. Nice tool.
Ken
-----Original Message-----
From: Snyder, Jason [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 22, 2001 3:17 PM
To: CF-Talk
Subject: Rounding to significant digits
I am running ColdFusion server 5.0 and when flipping through the docs I do
not see any Math functions to round to a particular number of significant
digits. Plus on Allaire's site I know about the custom tag gallery, but I
do not see a UDF (user defined function) gallery. Then when I searched the
archives on the list I did not find any mentions of this issue. (I used the
keywords 'significant digit.')
I could use something like this for my graphs using CFGRAPH. To make the
grid lines on a bar chart to be at even numbers I currently have things set
up to figure out the number of lines based on a multiple and the max based
on the same multiple. (So for example instead of having grid lines at
173.43, 192.53, etc, I may have a set multiple of 20 and have grid lines at
160, 180, etc.) Seeing that the user can enter in their own criteria and
dynamically build a graph that can have a very wide range of possible max
sizes I would like to have that multiple based on the max bar size over the
target number of grid lines plus 1 [RSgFig(MaxBS/TGLP1, 1) and round to one
digit of significance out of the results. So for example if maximum bar
size is 13 and my target number of grid lines is 7 it
would space the grid lines apart by 2. If the maximum bar size is 768 and
the target number of grid lines is 10 it would space the grid lines apart by
70.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists