Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: A new use for an obscure function Post Reply Post New Topic
Author Message
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Topic: A new use for an obscure function
    Posted: 27 Dec 2007 at 6:39am
I ran across an interesting function today, while browsing through the financial functions:  DollarFR.  This takes a decimal and a fractional index, and then returns a number that looks like a decimal, except that the part after the decimal is actually the number of fractions of the fractional index.  E.g.,

DollarFR(1.125, 8) = 1.1 because 1.125 = 1 1/8.
DollarFR(1.75, 4) = 1.3 because 1.75 = 1 3/4.

Now, suppose you made the fractional index 60.

DollarFR(1.25, 60) = 1.15 because 1.25 = 1 15/60.

Are you seeing the value?  How about if I adjust the formatting a touch?

DollarFR(1.25, 60) = 1:15

This is a remarkably simple way to do the conversions from fractional hours to hours and minutes (or from fractional minutes to minutes and seconds).  Given the number of FAQs I've seen to do that exact conversion, I'm surprised this hasn't come up before.


IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.