Skip to content

20d4f94b 5f83 1a8c d1a2 c814726c18da

Axel Kesseler edited this page Oct 3, 2019 · 2 revisions

CapacityEntity.GetUnit Method (String)

Returns a valid unit to be used.

Namespace: Plexdata.Converters.Entities
Assembly: Plexdata.CapacityConverter (in Plexdata.CapacityConverter.dll) Version: 1.0.1

Syntax

C#

private string GetUnit(
	string unit
)

Parameters

 

unit
Type: System.String
The unit to be verified.

Return Value

Type: String
The unit to be used.

Remarks

This method returns a valid unit to be used. The Unit1 is returned if parameter unit is null or empty, or consists only of white spaces. The Unit1 is returned if parameter unit is almost equal to Unit1. The Unit2 is returned if parameter unit is almost equal to Unit2. In any other case a trimmed version of unit is returned. Each string comparison takes place by using invariant culture as well as ignoring upper and lower cases.

See Also

Reference

CapacityEntity Class
GetUnit Overload
Plexdata.Converters.Entities Namespace

Clone this wiki locally