Click or drag to resize

SimplSharpDeviceHelperPercentToUshort Method

Method to convert percentages to valid ushort value the device can understand. This does

Namespace: Crestron.SimplSharpPro.DeviceSupport
Assembly: Crestron.SimplSharpPro.DeviceSupport (in Crestron.SimplSharpPro.DeviceSupport.dll) Version: 2.21.121
Syntax
C#
public static ushort PercentToUshort(
	float percentToConvert
)

Parameters

percentToConvert  Single
A float value from 0.000 to 100.000

Return Value

UInt16
Ushort value ranging from 0 to 65535 according to the formula Math.Round(65535 * (percentToConvert * 0.01)), with clipping to 65535 on an overflow.

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also