Function Updated 23 Oct 2026
format(value, format)
Formats a number or date into a string by given format.
Parameters
valueobjectrequiredValue to format into a string.
formatstringrequiredFormat string to format the value to:
For date fields:
/JavaScript/Date and time functions/Formatting dates
For number objects:
/JavaScript/Output functions/Formatting numbers
Returns
Value in specified format as string.
Example
Mixed HTML (or any text file) with inline JavaScript between hash signs.
#{
var dt = new Date();
write(docly.format(dt, "dd. MMM yyyy"));
}#The template above produces this output:
01. Nov 2026