Formatting the .ToString() function

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
onedumbtrucker
Posts: 14
Joined: Thu Nov 14, 2013 12:14 pm

Formatting the .ToString() function

Post by onedumbtrucker »

Hi All,

Was wondering if I am missing something here. I should be able to format the .ToString() function like this;

myValue.ToString("X2"); //Format value as hexidecimal with two digits

but for some reason iX developer will not allow it. Is this a namespace I have missed?

AMitchneck
Posts: 137
Joined: Mon Jun 11, 2012 2:10 pm

Re: Formatting the .ToString() function

Post by AMitchneck »

What is the type of myValue? different types support different formats.

If myValue is a tag, you need to specify

Code: Select all

string hex = Globals.Tags.myValue.Value.ToString("X2");
Adam M.
Controls Engineer
FlexEnergy

Post Reply