On this Page

    _fromDOUnits

    (As of 3.1.002.10)

    Convert a Base64-encoded string to plain text.

    Syntax

    _fromDOUnits(number[, units, decimals])

    Parameters

    number is an integer value of internal DocOrigin units to be converted.

    units is a string representation of a common units code (in, ", cm, mm, pt, pts).

    decimals is an integer value of the number of decimals to report. The default is 3 so as to match what the Design GUI reports.

    Returned Value

    Returns a floating point number of the specified common units, with the unit code appended, as a string.

    Description

    This routine converts an internal DocOrigin coordinates value (microns) into a string such as "1.25in". An invalid or missing common unit code results in the use of the default locale measurement (cm in case of Metric and inch otherwise).

    Example

     _fromDOUnits(2000000, "in");          // returns "2.000in"
     _fromDOUnits(this._absTop);           // returns cm or inch depending on current locale
     _fromDOUnits(2020000, "cm", 5));      // returns "5.13080cm"

    The expected usage here is simply to aid in debug output where you use _logf to report an object's height or position but do so in units that are more in keeping with the units you used in designing the form.

    See Also

    _toDOUnits
    Script Units