CFLib.org – Common Function Library Project

DogYearsToHumanYears(age)

Last updated February 14, 2002
Download UDF

author

David Fekke                                       David Fekke

Version: 1 | Requires: ColdFusion 5 | Library: UtilityLib

 
Rated 1 time(s). Average Rating: 1.0

Description:
This function translates a dogs age to human years. This function is merely an approximation and does not take into effect such factors as the dogs breed or size.

Return Values:

Example:

<cfset dog1 = 2>
<cfset dog2 = 5>
<cfset dog3 = 10>
<cfset dog4 = 12>

<cfoutput>
Dog 1 is #dog1# years old which is #DogYearsToHumanYears(dog1)# in human years.<br>
Dog 2 is #dog2# years old which is #DogYearsToHumanYears(dog2)# in human years.<br>
Dog 3 is #dog3# years old which is #DogYearsToHumanYears(dog3)# in human years.<br>
Dog 4 is #dog4# years old which is #DogYearsToHumanYears(dog4)# in human years.<br>
</cfoutput>

Parameters:

Name Description Required
age The age of the dog. Yes

Full UDF Source:

<cfscript>
/**
* This UDF translates a dogs age to a humans age.
*
* @param age      The age of the dog.
* @author David Fekke (david@fekke.com)
* @version 1, February 14, 2002
*/

function DogYearsToHumanYears(DogAge) {
return ((DogAge - 1)* 7) + 9;
}
</cfscript>

Search CFLib.org


Latest Additions

Tony Felice Tony Felice added
writeStateSelect
15 hour(s) ago

Tony Felice Tony Felice added
varNameToText
15 hour(s) ago

Larry C. Lyons Larry C. Lyons added
splitMX
15 hour(s) ago

Tony Felice Tony Felice added
listIsItemSimila...
15 hour(s) ago

Tony Felice Tony Felice added
listCountItemSim...
15 hour(s) ago

Top Rated

Rob Brooks-Bilson                                 ListCompare
Rated 5.0, 6 time(s)

Nathan Dintenfass                                 QueryStringChang...
Rated 5.0, 4 time(s)

Rob Brooks-Bilson                                 FormatSSN
Rated 5.0, 2 time(s)

Ben Forta                                         DollarAsString
Rated 5.0, 2 time(s)

Ed Hodder                                         CapFirstTitle
Rated 5.0, 2 time(s)

Created by Raymond Camden / Design by Justin Johnson