« Back to Product

Documentation

GetValueFormattedEx

Require: IP-Symcon >= 5.5

 string GetValueFormattedEx (int $VariableID, variant $value) 

Parameters

VariableID

ID of the variable

value

Value to be formatted

Returns

Value formatted to match the profile of the variable

Description

The function returns the content value Value after it has been formatted to match the variable profile of the variable with the ID VariableID. The actual value of the variable with the ID VariableID is irrelevant. Due to the formatting the variable type returned is always a string.

Example

echo GetValueFormattedEx(12345, true); //Profil = ~Switch
//Results in: On

echo GetValueFormattedEx(23456, 17.5); //Profile = ~ Temperature
//Results in: 17.5 ° C
Any questions?