I remember significant digits... Ahh, that takes me back to Introductory
Physical Science in 8th grade :) 

This doesn't quite work... But it might give you some ideas:

Where INTVALUE ist he number you are getting the percentage of (ex. 93, 1.1,
14) and .75 is the percentage in the equation.


<cfset intValue = 14 />
<cfset intDiv = (10 * (Len(intValue) - 1)) />


#(NumberFormat((intValue * .75 ) / intDiv, "0." & RepeatString(0,
Len(intValue) - 1)) * intDiv)#


Its rounding up... I can't remember the rules to sig-digits...

.......................
Ben Nadel 
www.bennadel.com


-----Original Message-----
From: Ian Skinner [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 23, 2006 4:22 PM
To: CF-Talk
Subject: Figuring out significant digit.

This is a bit unusual.  I want to figure out 75% of a given number and then
round | floor | ceiling this number to a significant digit of the number.
This is probably best described with examples.

75% of 93 = 69.75 floor to 60.
75% of 1.1 = 0.825 floor to 0.8
75% of 14 = 11.25 floor to 10
75% of .001 = 0.00075 floor to 0.0007
 
I am creating a series of charts from dynamic data.  I want to set the
minimum value of the chart based on a percentage of the minimum value being
displayed.  But I don't want to use values like 0.825 when my data is 1.1,
..9,1.3 ect.

Does this make sense?  I would also like to do a similar thing to set the
top of the chart axis by adding 10% to the max value of the data series.

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

---------
| 1 |   |
---------  Binary Soduko
|   |   |
---------
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any attachments is for the
sole use of the intended
recipient(s) and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited. If you
are not the intended recipient, please contact the sender and delete any
copies of this message. 





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:250796
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to