<cfx_kmFormat> cfx_kmSuite
Programming Reference

cfx_kmFormat contains functions related to data formatting and validation.

FullName
FullPhone
Help
IsValidCC16
IsValidISBN
ProperAddress
ProperCase
ProperName
SpellDollars
SpellNumber
Version


F=FullName

Description
Create a formatted person name, given some set of parts (title, first name, etc.),
Returns
Formatted person name.
Syntax
  <cfx_kmFormat  F=FullName  V=variable  SHOW
      FORMAT="FML" or "LFM"
      TITLE=title
      FIRST=fname
      MIDDLE=mname
      LAST=lname
      SUFFIX=suffix
      PROPER="Yes" or "No" >
Attribute   Description         Required?
FORMAT  Desired output format for the name
  FML=First-middle-last
  LFM=Last-first-middle
 no
TITLE  Desired title for the person's name, e.g. "Mr.", "Ms", "Sir", etc.  no
FIRST  Person's first name.  no
MIDDLE  Person's middle name or initial. If the name is one character long, it is assumed to be an initial and will have a period appended.  no
LAST  Person's last name.  no
SUFFIX  Desired suffix for the person's name, e.g. "Jr.", "Sr.", "Esquire", etc.  no
PROPER  Apply automatic "proper name" formatting. Refer to the ProperName function.  no


Examples

<cfx_kmFormat F=FullName TITLE="sir" FIRST="fred"
    MIDDLE="r" LAST="qwerty" SUFFIX="jr" PROPER=Yes>
Result:  Sir Fred R. Qwerty Jr



F=FullPhone

Create a formatted telephone number, given some set of parts (area code, extension, etc.).

Returns
Formatted telephone number.
Syntax
  <cfx_kmFormat  F=FullPhone  V=variable  SHOW
      AREA=number
      NUMBER=number
      EXT=number >
Attribute   Description         Required?
AREA  Area code.  no
NUMBER  Phone number.  no
EXT  Phone extension.  no


Examples

<cfx_kmFormat F=FullPhone AREA="612" NUMBER="5551212" EXT="711">
Result:  (612) 555-1212 Ext: 711



F=IsValidCC16

Check a credit card number, to determine if it is (potentially) valid. This routine determines whether the number is in proper format. It cannot determine whether the credit card itself is valid.

Returns
Yes=Card number is (potentially) valid.
No=Card number cannot be valid.

Free bonus information: If the credit card number is valid, the variable request.kmCCType is set to the credit card type, which may be: AMEX, VISA, MASTERCARD or DISCOVER.
Syntax
  <cfx_kmFormat  F=IsValidCC16  V=variable  SHOW
      CC=number>
Attribute   Description         Required?
CC  16 digit credit card number.  YES


Examples

<cfx_kmFormat F=IsValidCC16 CC="4466 1133 2244 7755">
Result:  NO



F=IsValidISBN

Check an ISBN number, to determine whether it is potentially valid. This routine cannot determine whether the ISBN number actually represents an existing book.

Returns
Yes=ISBN number is (potentially) valid.
No=ISBN number cannot be valid.
Syntax
  <cfx_kmFormat  F=IsValidISBN  V=variable  SHOW
      ISBN=number>
Attribute   Description         Required?
ISBN  ISBN book number.  YES


Examples

<cfx_kmFormat F=IsValidISBN ISBN="0-7897-1810-3">
Result:  YES



F=ProperAddress

Capitalized an address text. Special abbreviations, such as NW, SE, APO, etc., are recognized and converted to ALL CAPS.

Returns
Capitalized address text.
Syntax
  <cfx_kmFormat  F=ProperAddress  V=variable  SHOW
      ADDRESS=text>
Attribute   Description         Required?
ADDRESS  Address to be capitalized.  YES


Examples

<cfx_kmFormat F=ProperAddress
    ADDRESS="124 van nuys blvd sw">
Result:  124 Van Nuys Blvd SW



F=ProperCase

Capitalize each word in a text.

Returns
Capitalized text
Syntax
  <cfx_kmFormat  F=ProperCase  V=variable  SHOW
      VALUE=text >
Attribute   Description         Required?
VALUE  Text to be capitalized.  YES


Examples

<cfx_kmFormat F=ProperCase TEXT="mary had a little lamb.">
Result:  Mary Had A Little Lamb.



F=ProperName

Capitalized a person name. Certain names, such as those beginning in Mc, are recognized and properly capitalized.

Returns
Capitalized name text.
Syntax
  <cfx_kmFormat  F=ProperName  V=variable  SHOW
      NAME=text >
Attribute   Description         Required?
NAME  Name to be capitalized.  YES


Examples

<cfx_kmFormat F=ProperName NAME="bob a mcconnell">
Result:  Bob A McConnell



F=SpellDollars

Convert a decimal number to a dollar and cent amount, spelled out using English words.

Returns
Dollars and cents as English words.
Syntax
  <cfx_kmFormat  F=SpellDollars  V=variable  SHOW
      VALUE=number >
Attribute   Description         Required?
VALUE  Any number representing dollars and cents.  YES


Examples

<cfx_kmFormat F=SpellDollars VALUE=21945.67>
Result:  Twenty One Thousand Nine Hundred Forty Five Dollars and 67 Cents



F=SpellNumber

Convert a decimal number to a value spelled out using English words.

Returns
Decimal number as English words.
Syntax
  <cfx_kmFormat  F=SpellNumber  V=variable  SHOW
      VALUE=number >
Attribute   Description         Required?
VALUE  Any number.  YES


Examples

<cfx_kmFormat F=SpellNumber VALUE=21945.67>
Result:  Twenty One Thousand Nine Hundred Forty Five pt Sixty Seven