by the way (I just test ran this code, and it did work:) ), you should
actually change the step to "-2".
~Simon
-----Original Message-----
From: Simon Horwith [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 01, 2000 4:32 PM
To: CF-Talk
Subject: RE: Displaying decimal part as a fraction...
David:
try something like this:
<CFSET startvar = 4.9>
<CFSET step2 = DollarFormat(startvar)>
<CFSET step3 = Right(#step2#,2)>
<cfloop index="divisor" from="50" to="2" step="-1">
<CFIF step3 MOD divisor IS 0 AND 100 MOD divisor IS 0>
<CFSET fraction = step3/divisor & "/" & 100/divisor>
<CFBREAK>
</cfif>
</cfloop>
<cfoutput>#fraction#</cfoutput>
~Simon
-----Original Message-----
From: Rice, David [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 01, 2000 3:33 PM
To: CF-Talk
Subject: Displaying decimal part as a fraction...
All,
I know I've seen somewhere how to do this, but I can no longer remember
where I saw it:
A fellow programmer needs to show the decimal part of a currency value
(i.e., $1.<10>) as a 10/100 format fraction. Don't even ask why one would
want such functionality--the explanation would probably make no more sense
to you than it did when explained to me... ;)
Does anyone have a custom tag, or a customized way to do this that I could
use?
Many thanks in advance,
--
David L. Rice
Web Applications Developer
Nation Tax, Inc.
[EMAIL PROTECTED]
Direct: 205.380.8164
eFax: 253.550.8239
Demo our services @ www.nationtax.com
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]