Harness proD API Help
EPLAN.Harness.API.ApiProperties.UnitProperties Namespace / UnitClassProperty Class / ToString Method / ToString(Boolean) Method
Specifies whether the unit will be included in the result text.
Example
In This Topic
    ToString(Boolean) Method
    In This Topic
    Text representation of this property with the specified formating.
    Syntax
    public string ToString( 
       bool withUnit
    )

    Parameters

    withUnit
    Specifies whether the unit will be included in the result text.

    Return Value

    Returns a string that represents the value of this property.
    Example
    The following example shows how to format the text representation of a property.
    MassProperty mass = new MassProperty(23.40258, Unit.Kilogram);
    Console.WriteLine($"Without unit: {mass.ToString(false)}");
    Console.WriteLine($"with a unit: {mass.ToString(true)}");
    // Result:
    // Without unit: 23,4
    // with a unit: 23,4 kg
    See Also