18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix: Built-in Scripting Language<br />

The character used as the decimal mark, which separates the integer and fractional parts of the<br />

numerical value.<br />

This is an optional parameter; if no value is specified, then the default is a period (.). For<br />

example: "123.45"<br />

optStrThousandSep<br />

The character used as the thousands separator, which separates the hundreds and thousands<br />

digits of the numerical value.<br />

This is an optional parameter; if no value is specified, then the default is a comma (,). For<br />

example: "12,345"<br />

Returned value<br />

This function returns a string that contains the formatted numerical value.<br />

Notes<br />

Format is similar to the printf function in other programming languages, and it allows most of the same<br />

formatting options. However, unlike printf, Format can be used to format only one numerical value at a<br />

time.<br />

This function is particularly useful for formatting values to be printed in reports.<br />

Examples<br />

Tag Name<br />

Expression<br />

Tag Format( "%d", 12.34 ) // Returned value = "12"<br />

Tag Format( "%04d", 12.34 ) // Returned value = "0012"<br />

Tag Format( "%4d", 12.34 ) // Returned value = "12"<br />

Tag Name<br />

Tag<br />

Tag<br />

Tag<br />

Expression<br />

Format( "%x", 26 ) // Returned value = "1a"<br />

Format( "%04x", 26 ) // Returned value = "001a"<br />

Format( "%4x", 26 ) // Returned value = "1a"<br />

Tag Name<br />

Tag<br />

Tag<br />

Tag<br />

Expression<br />

Format( "%X", 26 ) // Returned value = "1A"<br />

Format( "%04X", 26 ) // Returned value = "001A"<br />

Format( "%4X", 26 ) // Returned value = "1A"<br />

Tag Name<br />

Expression<br />

Tag Format( "%o", 16 ) // Returned value = "20"<br />

Tag Format( "%04o", 16 ) // Returned value = "0020"<br />

Tag Format( "%4o", 16 ) // Returned value = "20"<br />

Tag Name<br />

Expression<br />

Tag Format( "%b", 2 ) // Returned value = "10"<br />

Tag Format( "%4b", 2 ) // Returned value = "0010"<br />

Tag Format( "%04b", 2 ) // Returned value = "0010"<br />

Page 536<br />

<strong>InduSoft</strong> Web Studio

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!