Function Updated 23 Oct 2026
setCulture(culture)
Sets culture to use when formatting dates and numbers.
Parameters
culturenumberrequiredCulture LCID number (e.g. 1044) or culture name (e.g. "nb-NO"). An unknown culture leaves the current culture unchanged, without an error.
Returns
Nothing (an empty string). Writes nothing to the output.
Example
Mixed HTML (or any text file) with inline JavaScript between hash signs.
<h1>Formatting with Norwegian currency format</h1>
#{
/* Set culture */
docly.setCulture(1044);
/* Can be used when formatting numbers and dates: */
var number = 10000.50;
write(docly.format(number, "C"));
}#The template above produces this output:
<h1>Formatting with Norwegian currency format</h1>
kr 10 000,50