Format Tag Value

Hello,

for my project i use opc Tags to get the values i want to monitor. These values got a lot of numbers after the decimal points. As i just need two numbers after the decimal points i wonder if it is possible to have just the two numbers in the tag value and therefore in the historical data of the tag.

Floating point values tend to always have many digits, especially considering the fact that binary numbers have repeating bits after the point where true decimal numbers do not. It is a mistake to round for storage.

Tags have a format property that governs how many decimal places to display by default, and GUI components can use their own formats as needed.

If you really need storage rounded to a particular number of decimal digits, don't use the historian. Instead, use a Transaction Group (SQL Bridge Module) to record to a DB table where the columns use a decimal column type instead of floating point. (You can script the inserts to such a table, too, if you don't want to use the SQL Bridge module.)

1 Like