Docly Developers
Function Updated 23 Oct 2026

setCulture(culture)

Sets culture to use when formatting dates and numbers.

Parameters

culturenumberrequired

Culture 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"));
}#