REAL_TO-/LREAL_TO conversions

Converting from the variable type REAL or LREAL to a different type:
The value will be rounded up or down to the nearest whole number and converted into the new variable type. Exceptions to this are the variable types STRING, BOOL, REAL and LREAL. When you perform a type conversion from a larger to a smaller type, you risk losing some information.

Please regard at a conversion to type STRING that the total number of digits is limited to 16. If the (L)REAL-number has more digits, then the sixteenth will be rounded. If the length of the STRING is defined to short, it will be cut beginning from the right end.

Example in ST:

i := REAL_TO_INT(1.5); (* Result is 2 *)

j := REAL_TO_INT(1.4); (* Result is 1 *)

k := LREAL_TO_STRING(); (* Result is '1.4' *)

Example in IL:

LD 2.7

REAL_TO_INT

GE %MW8