PTFormat & PTFormatDouble

<< Click to Display Table of Contents >>

Navigation:  PlantExpressTools > How to use > Calculations > Additional Functions >

PTFormat & PTFormatDouble

Previous pageReturn to chapter overviewNext page

With the two format functions you can format your property values to suite your needs.

PTFormat

This function has two arguments. The first one is the format string which defines how the resulting string should be formatted. The second argument is the value you want to format.

The following example uses the current local time.

Calculations 75

The result is a date format how it is:

Calculations 85

The formatting expressions are based on Microsoft. An overview can be found under the following link:

http://www.independent-software.com/net-string-formatting-in-csharp-cheat-sheet.html

PTFormatDouble

PTFormatDouble is just a quick way to format a string to add x amount of decimal places.

Calculations 76

And this is how the result looks like.

Calculations 86

Next Chapter: PTGetAllScriptParameters & PTGetScriptParameter