HotDocs Function | Native JavaScript equivalent | Knackly Equivalent | |
TEXT + TEXT | text + text | ||
FIRST( TEXT, NUM ) | text.substring(0, num) | text.first(num) | (extended String prototype) |
INTEGER( TEXT ) | Number.parseInt(text) | text.toInt() | (extended String prototype) |
LAST( TEXT, NUM ) | text.slice(-num) | text.last(num) | (extended String prototype) |
LENGTH( TEXT ) | text.length | text.length | |
MID( TEXT, NUM, NUM ) | text.substring(num, num) | text.substring(num, num) | |
POSITION( TEXT, TEXT ) (case insensitive) | text.indexOf(text) (case sensitive) | text.indexOf(text) (case sensitive) | |
REPLACE( TEXT, TEXT, TEXT, NUM ) (case insensitive) | text.replace(text, text) (case sensitive) | text.replaceAll(text, text) | (extended String prototype) |
SPACE( TEXT, TEXT ) | text ? text + " " : "" (ternary operator) | text ? text + " " : "" (ternary operator) | |
STRIP( TEXT, TEXT, TRUE_FALSE, TRUE_FALSE ) | text.strip(text, true_false, true_false) | (extended String prototype) | |
TRIM( TEXT ) | text.trim() | text.trim() | |
NUM + NUM | num + num | num + num | |
NUM - NUM | num - num | num - num | |
NUM * NUM | num * num | num * num | |
NUM / NUM | num / num | num / num | |
ABSOLUTE VALUE( NUM ) | Math.abs(num) | math.abs(num) | |
CEILING( NUM ) | Math.ceil(num) | math.ceil(num) | |
EXPONENTIAL( NUM ) | Math.exp(num) | math.exp(num) | |
FLOOR( NUM ) | Math.floor(num) | math.floor(num) | |
LOGARITHM( NUM ) | Math.log10(num) | math.log10(num) | |
MAX( NUM, NUM ) | Math.max(num, num, …) | math.max(num, num, …) | |
MIN( NUM, NUM ) | Math.min(num, num, …) | math.min(num, num, …) | |
NATURAL LOGARITHM( NUM ) | Math.log(num) | math.log(num) | |
POWER( NUM, NUM ) | Math.pow(num, num) | math.pow(num, num) | |
REMAINDER( NUM, NUM ) | num % num | num % num | |
ROUND( NUM, NUM ) | Math.round(num) | math.round(num) | |
SQUARE ROOT( NUM ) | Math.sqrt(num) | math.sqrt(num) | |
TRUNCATE( NUM, NUM ) | Math.trunc(num) | math.trunc(num) | |
ZERO( NUM_VAR ) | x ? x : 0 (conditional/ternary operator) | x ? x : 0 (conditional/ternary operator) | |
FUTURE VALUE (RATE, TERM, PAYMENT, PRESENT VALUE, TYPE) | finance.FV() | ||
PAYMENT (RATE, TERM, PRESENT VALUE, FUTURE VALUE, TYPE) | finance.PMT() | ||
PRESENT VALUE (RATE, TERM, PAYMENT, FUTURE VALUE, TYPE) | finance.PV() | ||
RATE (TERM, PAYMENT, PRESENT VALUE, FUTURE VALUE, TYPE) | finance.RATE() | ||
TERM (RATE, PAYMENT, PRESENT VALUE, FUTURE VALUE, TYPE) | finance.NPER() | ||
TODAY | Date.now() | date.today() | |
DATE + NUM DAYS | date.addDays(date, num) | ||
DATE + NUM MONTHS | date.addMonths(date, num) | ||
DATE + NUM YEARS | date.addYears(date, num) | ||
DATE - NUM DAYS | date.subDays(date, num) | ||
DATE - NUM MONTHS | date.subMonths(date, num) | ||
DATE - NUM YEARS | date.subYears(date, num) | ||
AGE( DATE ) | date.age(date) | ||
DATE OF( DAY, MONTH, YEAR ) | new Date(year, month-1, day) | date.new(year, month, day) | |
DAY OF( DATE ) | date.getDate() | date.dayOf(date) | |
DAY OF WEEK( DATE ) | date.getDay() | date.dayOfWeek(date) | |
DAYS FROM( START, FINISH ) | date.daysBetween(date, date) | ||
MONTH OF( DATE ) | date.getMonth() | date.monthOf(date) | |
MONTHS FROM( DATE, DATE ) | date.monthsBetween(date, date) | ||
YEAR OF( DATE ) | date.getYear() | date.yearOf(date) | |
YEARS FROM( DATE, DATE ) | date.yearsBetween(date, date) | ||
NOT TRUE_FALSE | !true_false | !true_false | |
TRUE_FALSE AND TRUE_FALSE | true_false && true_false | true_false && true_false | |
TRUE_FALSE OR TRUE_FALSE | true_false || true_false | true_false || true_false | |
TRUE_FALSE = TRUE_FALSE | true_false == true_false | true_false == true_false | |
TRUE_FALSE != TRUE_FALSE | true_false != true_false | true_false != true_false | |
TEXT = TEXT (case insensitive) | text == text (case sensitive) | text == text (case sensitive) | |
TEXT != TEXT (case insensitive) | text != text (case sensitive) | text != text (case sensitive) | |
TEXT CONTAINS TEXT (case insensitive) | text.includes(text) (case sensitive) | text.includes(text) (case sensitive) | |
TEXT ENDS WITH TEXT (case insensitive) | text.endsWith(text) (case sensitive) | text.endsWith(text) (case sensitive) | |
TEXT STARTS WITH TEXT (case insensitive) | text.startsWith(text) (case sensitive) | text.startsWith(text) (case sensitive) | |
TEXT < TEXT (case insensitive) | text < text (case sensitive) | text < text (case sensitive) | |
TEXT <= TEXT (case insensitive) | text <= text (case sensitive) | text <= text (case sensitive) | |
TEXT > TEXT (case insensitive) | text > text (case sensitive) | text > text (case sensitive) | |
TEXT >= TEXT (case insensitive) | text >= text (case sensitive) | text >= text (case sensitive) | |
MULT_CHOICE = TEXT (case insensitive) | array.includes(text) (case sensitive) | array.includes(text) (case sensitive) | |
MULT_CHOICE != TEXT (case insensitive) | !array.includes(text) (case sensitive) | !array.includes(text) (case sensitive) | |
NUM = NUM | num == num | num == num | |
NUM != NUM | num != num | num != num | |
NUM < NUM | num < num | num < num | |
NUM <= NUM | num <= num | num <= num | |
NUM > NUM | num > num | num > num | |
NUM >= NUM | num >= num | num >= num | |
DATE = DATE | date.isEqualTo( date ) | (extended Date prototype) | |
DATE != DATE | date.isNotEqualTo( date ) | (extended Date prototype) | |
DATE < DATE | date.isBefore( date ) | (extended Date prototype) | |
DATE <= DATE | date.isNotAfter( date ) | (extended Date prototype) | |
DATE > DATE | date.isAfter( date ) | (extended Date prototype) | |
DATE >= DATE | date.isNotBefore( date ) | (extended Date prototype) | |
ANSWERED( VAR ) | x (check the var's 'truthiness') | x (check the var's 'truthiness') | |
ANSWERED( DIALOG ) | |||
FORMAT( VALUE, "EXAMPLE" ) | see "filters" document | ||
UNANSWERED | null | null | |
VALUE( VAR, EXPRESSION ) | x ? x : expression | x ? x : expression | |
COUNT( DIALOG ) | array.length | array.length | |
COUNT( MULT_CHOICE_VAR ) | array.length | array.length | |
COUNTER | _index, _index0 | note also _parent, which HotDocs did not have | |
SUM( COMPUTATION_VAR ) | |||
SUM( NUM_VAR ) | |||
SELECTION( MULT_CHOICE_VAR, NUM ) | array[num] | array[num] | |
OTHER( MULT_CHOICE_VAR ) | n/a | ||
UNION( MULT_CHOICE, MULT_CHOICE ) | array.concat(array) | array.concat(array) |
HotDocs to Knackly Functions Print
Created by: Kim Mayberry
Modified on: Thu, 2 Apr, 2020 at 9:21 AM
Did you find it helpful? Yes No
Send feedbackSorry we couldn't be helpful. Help us improve this article with your feedback.