User API

Formatter

Other API in Package

Web

Internal Tunnel

Internal Web

Tunnel

Method Summary
String avg(String key, String number, int places)

Adds the number to internal counter and outputs the average. Returns null on failure.

String chop(String value, int size, boolean ellipses)

If the value exceeds the given size, this method chops and returns it the value, optionally with ellipses (...).

String chopLeft(String value, int size, boolean ellipses)

If the value exceeds the given size, this method chops and returns the right-most characters, optionally with ellipses (...).

String dec(String key)

Decrements the internal counter by 1 and outputs the number. Returns null on failure.

String encodeURI(String uri)

Does a URI encoding on the supplied value.

String formatCurrency(String value)

Formats the given string to currency notation.

String formatCurrencyAsWords(String num)

Formats the currency as words (ex: 32.50 converts to thirty two dollars and fifty cents)

String formatCurrencyAsWords(double num)

Formats the currency as words (ex: 32.50 converts to thirty two dollars and fifty cents)

String formatDate(Date date, String pattern)

Formats the given date using the given java date pattern (see java.text.SimpleDateFormat for sample patterns)

String formatDate(Date date, String pattern, String timeZone)

Formats the given date using the given java date pattern (see java.text.SimpleDateFormat for sample patterns) and the given time zone code (e.g. PST).

String formatDateString(String date, String pattern)

Formats the given date string using the given java date pattern (see java.text.SimpleDateFormat for sample patterns)

String formatDateString(String date, String pattern, String timeZone)

Formats the given date string using the given java date pattern (see java.text.SimpleDateFormat for sample patterns) and the given time zone code (e.g. PST).

String formatEIN(String ein)

Formats a 9 digit EIN. (ex: 123456789 converts to 12-3456789). Returns the parameter without formatting if the length of the string is not 9.

String formatFullCurrency(String value)

Formats the given string to currency notation. Preserves full decimal places up to 9 places to the right.

String formatNumber(String num, String places)

Returns the given number as comma-formatted string to the specified decimal places.

String formatNumber(double num, int places)

Returns the given number as comma-formatted string to the specified decimal places.

String formatPhone(String phone)

Formats a 10 digit phone number. (ex: 1234567890 converts to (123) 456-7890). Returns phone parameter without formatting if the length of the string is not 10.

String formatPhone1(String phone)

Formats a phone to a dashed digit phone number. (ex: converts (123) 456-7890 to 123-456-7890).

String formatPhone2(String phone)

Formats a phone to a 10 digit phone number. (ex: converts (123) 456-7890 to 1234567890).

String formatSSN(String ssn)

Formats a 9 digit social security number. (ex: 123456789 converts to 123-45-6789). Returns ssn parameter without formatting if the length of the string is not 9.

String formatXMLDate(Date date)

Returns the date in xsd:date compliant format in UTC. The format will be yyyy-MM-ddTHH:mm:ssZ

String formatXMLDateString(String date)

Attempts to create a Date from the string then returns the date in xsd:date compliant format in UTC. The format will be yyyy-MM-ddTHH:mm:ssZ. Returns null if the date cannot be determined from the input string.

String formatZipCode(String zipCode)

Formats a 5 or 9 digit US Zip code. (ex: 123456789 converts to 12345-6789). Returns the parameter without formatting if the length of the string is not 9.

String getContinent(String isoCont)

Returns the full name of the continent from the iso code.

String getCountry(String countryCode)

Returns the full name of the country from the iso code.

String getDayOfWeekAsWord(String day)

Returns the name of the day of week based on the number. 1 is Sunday, 7 is Saturday

String getMonthAsWord(String num)

Converts a number 1-12 to month. (ex: 11 converts to 'November')

String getNumberAsOrdinal(String num)

Converts number to ordinal value. (ex: 2 converts to '2nd')

String getNumberAsOrdinal(int num)

Converts number to ordinal value. (ex: 2 converts to '2nd')

String getNumberAsWord(String num)

Converts number to word. (ex: 123 converts to 'one hundred twenty three')

String getNumberAsWord(int num)

Converts number to word. (ex: 123 converts to 'one hundred twenty three')

String getRandomEasyNumber(String length)

Returns a random number sequence including numbers 2-9 of size length. Maximum length is 50, minimum is 1.

String getRandomEasyNumber(int length)

Returns a random number sequence including numbers 2-9 of size length. Maximum length is 50, minimum is 1.

String getRandomNumber(String length)

Returns a random number sequence including numbers 0-9 of size length. Maximum length is 50, minimum is 1.

String getRandomNumber(int length)

Returns a random number sequence including numbers 0-9 of size length. Maximum length is 50, minimum is 1.

String getShortMonthAsWord(String num)

Converts a number 1-12 to abbreviated month. (ex: 11 converts to 'Nov')

String getState(String countryCode, String stateCode)

Returns the full name of the state from the state and country iso code.

String getState(String stateCode)

Returns the full name of the state from the US iso code.

String getValidSigningRole(String role)

Returns a valid role for signing purposes. Roles have a size and content restriction. If role is empty, this returns the String 'role'. A valid signing role is alpha-numeric with zero or more of the following characters (including space): @.-_${}. Keep in mind, a JEXL role requires a JEXL rendering cycle to translate and may result in an error if you don't provide the translation. See Packet.addDocument(String,Data).

String inc(String key)

Increments the internal counter by 1 and outputs the number. Returns null on failure.

String inject(String text, String value, int size)

If the text exceeds the given size, this method injects the specified value at every size interval and returns the new text. Used for injecting whitespace.

double parseDouble(String value)

Parses the given value into a double. Throws an error if the value cannot be converted.

int parseInt(String value)

Parses the given value into an integer. Throws an error if the value cannot be converted.

String removeNonAsciiChars(String content)

Removes all characters outside of the UTF-8 C1 Controls and Latin1 Supplement (keeps characters in the range 0-255 decimal).

String replace(String content, String find, String replace, boolean all)

Replaces the first occurrence of 'find' in 'content' with 'replace' or all occurances if all is true and returns the modified content.

String substring(String string, int start, int numCharacters)

Returns a sub-string of the given string starting at the specified location. Returns null if the starting point is greater than the length.

String sum(String key, String number, int places)

Adds the number to internal counter and outputs the sum. Returns null on failure.

String toGigaBytes(String num, String places)

Returns the given number (bytes) as gigabytes to the specified decimal places.

String toGigaBytes(double num, int places)

Returns the given number (bytes) as gigabytes to the specified decimal places.

String toKiloBytes(String num, String places)

Returns the given number (bytes) as kilobytes to the specified decimal places.

String toKiloBytes(double num, int places)

Returns the given number (bytes) as kilobytes to the specified decimal places.

String toLowerCase(String value)

Returns the value as all lower case.

String toMegaBytes(String num, String places)

Returns the given number (bytes) as megabytes to the specified decimal places.

String toMegaBytes(double num, int places)

Returns the given number (bytes) as megabytes to the specified decimal places.

String toUpperCase(String value)

Returns the value as all upper case.

String trim(String value)

Returns the value with leading and trailing whitespace removed.

String trimAll(String value)

Returns the value with leading and trailing whitespace removed, including non breaking spaces.

Method Detail


String avg(String key, String number, int places)

Adds the number to internal counter and outputs the average. Returns null on failure.

Parameters:

  • String   key
  • String   number
  • int   places Required parameter.

Returns:  String

Since: 11-03-2011

top

String chop(String value, int size, boolean ellipses)

If the value exceeds the given size, this method chops and returns it the value, optionally with ellipses (...).

Parameters:

  • String   value
  • int   size
  • boolean   ellipses

Returns:  String

Since: 12-03-2008

top

String chopLeft(String value, int size, boolean ellipses)

If the value exceeds the given size, this method chops and returns the right-most characters, optionally with ellipses (...).

Parameters:

  • String   value
  • int   size
  • boolean   ellipses

Returns:  String

Since: 08-05-2021

top

String dec(String key)

Decrements the internal counter by 1 and outputs the number. Returns null on failure.

Parameters:

  • String   key

Returns:  String

Since: 11-03-2011

top

String encodeURI(String uri)

Does a URI encoding on the supplied value.

Parameters:

  • String   uri

Returns:  String

Since: 10-01-2010

top

String formatCurrency(String value)

Formats the given string to currency notation.

Parameters:

  • String   value

Returns:  String

Since: 03-08-2007

top

String formatCurrencyAsWords(String num)

Formats the currency as words (ex: 32.50 converts to thirty two dollars and fifty cents)

Parameters:

  • String   num

Returns:  String

Since: 07-01-2010

top

String formatCurrencyAsWords(double num)

Formats the currency as words (ex: 32.50 converts to thirty two dollars and fifty cents)

Parameters:

  • double   num

Returns:  String

Since: 11-15-2007

top

String formatDate(Date date, String pattern)

Formats the given date using the given java date pattern (see java.text.SimpleDateFormat for sample patterns)

Parameters:

  • Date   date
  • String   pattern

Returns:  String

Since: 03-08-2007

top

String formatDate(Date date, String pattern, String timeZone)

Formats the given date using the given java date pattern (see java.text.SimpleDateFormat for sample patterns) and the given time zone code (e.g. PST).

Parameters:

  • Date   date
  • String   pattern
  • String   timeZone

Returns:  String

Since: 10-07-2021

top

String formatDateString(String date, String pattern)

Formats the given date string using the given java date pattern (see java.text.SimpleDateFormat for sample patterns)

Parameters:

  • String   date
  • String   pattern

Returns:  String

Since: 08-22-2007

top

String formatDateString(String date, String pattern, String timeZone)

Formats the given date string using the given java date pattern (see java.text.SimpleDateFormat for sample patterns) and the given time zone code (e.g. PST).

Parameters:

  • String   date
  • String   pattern
  • String   timeZone

Returns:  String

Since: 10-07-2021

top

String formatEIN(String ein)

Formats a 9 digit EIN. (ex: 123456789 converts to 12-3456789). Returns the parameter without formatting if the length of the string is not 9.

Parameters:

  • String   ein

Returns:  String

Since: 06-24-2010

top

String formatFullCurrency(String value)

Formats the given string to currency notation. Preserves full decimal places up to 9 places to the right.

Parameters:

  • String   value

Returns:  String

Since: 04-01-2011

top

String formatNumber(String num, String places)

Returns the given number as comma-formatted string to the specified decimal places.

Parameters:

  • String   num
  • String   places

Returns:  String

Since: 07-01-2010

top

String formatNumber(double num, int places)

Returns the given number as comma-formatted string to the specified decimal places.

Parameters:

  • double   num
  • int   places

Returns:  String

Since: 11-15-2007

top

String formatPhone(String phone)

Formats a 10 digit phone number. (ex: 1234567890 converts to (123) 456-7890). Returns phone parameter without formatting if the length of the string is not 10.

Parameters:

  • String   phone

Returns:  String

Since: 11-04-2009

top

String formatPhone1(String phone)

Formats a phone to a dashed digit phone number. (ex: converts (123) 456-7890 to 123-456-7890).

Parameters:

  • String   phone

Returns:  String

Since: 06-27-2020

top

String formatPhone2(String phone)

Formats a phone to a 10 digit phone number. (ex: converts (123) 456-7890 to 1234567890).

Parameters:

  • String   phone

Returns:  String

Since: 06-27-2020

top

String formatSSN(String ssn)

Formats a 9 digit social security number. (ex: 123456789 converts to 123-45-6789). Returns ssn parameter without formatting if the length of the string is not 9.

Parameters:

  • String   ssn

Returns:  String

Since: 11-04-2009

top

String formatXMLDate(Date date)

Returns the date in xsd:date compliant format in UTC. The format will be yyyy-MM-ddTHH:mm:ssZ

Parameters:

  • Date   date Required parameter.

Returns:  String

Since: 03-21-2013

top

String formatXMLDateString(String date)

Attempts to create a Date from the string then returns the date in xsd:date compliant format in UTC. The format will be yyyy-MM-ddTHH:mm:ssZ. Returns null if the date cannot be determined from the input string.

Parameters:

  • String   date Required parameter.

Returns:  String

Since: 03-21-2013

top

String formatZipCode(String zipCode)

Formats a 5 or 9 digit US Zip code. (ex: 123456789 converts to 12345-6789). Returns the parameter without formatting if the length of the string is not 9.

Parameters:

  • String   zipCode

Returns:  String

Since: 06-24-2010

top

String getContinent(String isoCont)

Returns the full name of the continent from the iso code.

Parameters:

  • String   isoCont

Returns:  String

Since: 02-24-2021

top

String getCountry(String countryCode)

Returns the full name of the country from the iso code.

Parameters:

  • String   countryCode

Returns:  String

Since: 02-24-2021

top

String getDayOfWeekAsWord(String day)

Returns the name of the day of week based on the number. 1 is Sunday, 7 is Saturday

Parameters:

  • String   day  - 1=Sunday, 7=Saturday.

Returns:  String

Since: 01-08-2015

top

String getMonthAsWord(String num)

Converts a number 1-12 to month. (ex: 11 converts to 'November')

Parameters:

  • String   num

Returns:  String

Since: 01-14-2009

top

String getNumberAsOrdinal(String num)

Converts number to ordinal value. (ex: 2 converts to '2nd')

Parameters:

  • String   num

Returns:  String

Since: 07-01-2010

top

String getNumberAsOrdinal(int num)

Converts number to ordinal value. (ex: 2 converts to '2nd')

Parameters:

  • int   num

Returns:  String

Since: 11-08-2007

top

String getNumberAsWord(String num)

Converts number to word. (ex: 123 converts to 'one hundred twenty three')

Parameters:

  • String   num

Returns:  String

Since: 07-01-2010

top

String getNumberAsWord(int num)

Converts number to word. (ex: 123 converts to 'one hundred twenty three')

Parameters:

  • int   num

Returns:  String

Since: 03-08-2007

top

String getRandomEasyNumber(String length)

Returns a random number sequence including numbers 2-9 of size length. Maximum length is 50, minimum is 1.

Parameters:

  • String   length

Returns:  String

Since: 04-08-2011

top

String getRandomEasyNumber(int length)

Returns a random number sequence including numbers 2-9 of size length. Maximum length is 50, minimum is 1.

Parameters:

  • int   length Required parameter.

Returns:  String

Since: 04-08-2011

top

String getRandomNumber(String length)

Returns a random number sequence including numbers 0-9 of size length. Maximum length is 50, minimum is 1.

Parameters:

  • String   length

Returns:  String

Since: 04-08-2011

top

String getRandomNumber(int length)

Returns a random number sequence including numbers 0-9 of size length. Maximum length is 50, minimum is 1.

Parameters:

  • int   length Required parameter.

Returns:  String

Since: 04-08-2011

top

String getShortMonthAsWord(String num)

Converts a number 1-12 to abbreviated month. (ex: 11 converts to 'Nov')

Parameters:

  • String   num

Returns:  String

Since: 01-14-2009

top

String getState(String countryCode, String stateCode)

Returns the full name of the state from the state and country iso code.

Parameters:

  • String   countryCode
  • String   stateCode

Returns:  String

Since: 02-24-2021

top

String getState(String stateCode)

Returns the full name of the state from the US iso code.

Parameters:

  • String   stateCode

Returns:  String

Since: 02-24-2021

top

String getValidSigningRole(String role)

Returns a valid role for signing purposes. Roles have a size and content restriction. If role is empty, this returns the String 'role'. A valid signing role is alpha-numeric with zero or more of the following characters (including space): @.-_${}. Keep in mind, a JEXL role requires a JEXL rendering cycle to translate and may result in an error if you don't provide the translation. See Packet.addDocument(String,Data).

Parameters:

  • String   role

Returns:  String

Since: 11-10-2010

top

String inc(String key)

Increments the internal counter by 1 and outputs the number. Returns null on failure.

Parameters:

  • String   key

Returns:  String

Since: 11-03-2011

top

String inject(String text, String value, int size)

If the text exceeds the given size, this method injects the specified value at every size interval and returns the new text. Used for injecting whitespace.

Parameters:

  • String   text
  • String   value
  • int   size

Returns:  String

Since: 01-28-2016

top

double parseDouble(String value)

Parses the given value into a double. Throws an error if the value cannot be converted.

Parameters:

  • String   value

Returns:  double

Since: 04-26-2007

top

int parseInt(String value)

Parses the given value into an integer. Throws an error if the value cannot be converted.

Parameters:

  • String   value

Returns:  int

Since: 04-26-2007

top

String removeNonAsciiChars(String content)

Removes all characters outside of the UTF-8 C1 Controls and Latin1 Supplement (keeps characters in the range 0-255 decimal).

Parameters:

  • String   content

Returns:  String

Since: 03-10-2021

top

String replace(String content, String find, String replace, boolean all)

Replaces the first occurrence of 'find' in 'content' with 'replace' or all occurances if all is true and returns the modified content.

Parameters:

  • String   content
  • String   find
  • String   replace
  • boolean   all

Returns:  String

Since: 04-26-2007

top

String substring(String string, int start, int numCharacters)

Returns a sub-string of the given string starting at the specified location. Returns null if the starting point is greater than the length.

Parameters:

  • String   string
  • int   start
  • int   numCharacters

Returns:  String

Since: 06-24-2010

top

String sum(String key, String number, int places)

Adds the number to internal counter and outputs the sum. Returns null on failure.

Parameters:

  • String   key
  • String   number
  • int   places Required parameter.

Returns:  String

Since: 11-03-2011

top

String toGigaBytes(String num, String places)

Returns the given number (bytes) as gigabytes to the specified decimal places.

Parameters:

  • String   num
  • String   places

Returns:  String

Since: 07-01-2010

top

String toGigaBytes(double num, int places)

Returns the given number (bytes) as gigabytes to the specified decimal places.

Parameters:

  • double   num
  • int   places

Returns:  String

Since: 05-11-2010

top

String toKiloBytes(String num, String places)

Returns the given number (bytes) as kilobytes to the specified decimal places.

Parameters:

  • String   num
  • String   places

Returns:  String

Since: 07-01-2010

top

String toKiloBytes(double num, int places)

Returns the given number (bytes) as kilobytes to the specified decimal places.

Parameters:

  • double   num
  • int   places

Returns:  String

Since: 09-17-2007

top

String toLowerCase(String value)

Returns the value as all lower case.

Parameters:

  • String   value

Returns:  String

Since: 11-18-2008

top

String toMegaBytes(String num, String places)

Returns the given number (bytes) as megabytes to the specified decimal places.

Parameters:

  • String   num
  • String   places

Returns:  String

Since: 07-01-2010

top

String toMegaBytes(double num, int places)

Returns the given number (bytes) as megabytes to the specified decimal places.

Parameters:

  • double   num
  • int   places

Returns:  String

Since: 09-17-2007

top

String toUpperCase(String value)

Returns the value as all upper case.

Parameters:

  • String   value

Returns:  String

Since: 11-18-2008

top

String trim(String value)

Returns the value with leading and trailing whitespace removed.

Parameters:

  • String   value

Returns:  String

Since: 10-15-2009

top

String trimAll(String value)

Returns the value with leading and trailing whitespace removed, including non breaking spaces.

Parameters:

  • String   value

Returns:  String

Since: 06-16-2011

top
Copyright © 2006 - 2024, ContractPal, Inc. All rights reserved. API Date: Dec 03, 2024 10:24 AM