Parameter Format Specifiers

When text is selected for replacement with a parameter, the HyperStudy Editor recognizes the format and size of the highlighted text. This specifier controls how the data is written to the file. The formatting should be adjusted as required.

A specifier begins with a % and ends with an alphabetic character that controls the basic format type.
f
Floating point number
i
Integer
e
Exponential
s
String
Between the % and the type character is a number to define the width of the field.
%8i
An integer printed to be 8 characters wide
%7s
Prints a string 7 characters wide
For numeric data, the number of digits of precision can be controlled explicitly by inserting a period and a number after the format. Consider the number -5:
  • Formatting -5 with %8.5f will result in -5.00000, a floating point number 8 characters wide with precision 5.
  • Formatting 123.456789 with % 8.2e will result in 1.23e+02.
    Note: When additional precision is needed in field formats like OptiStruct and Nastran, consider using free format the individual line.
By convention, the formatting is right justified. In order to force left justification, the – character can be used before the field width.
  • 5.1 formatted as %-8.2 will produce “5.10 “. Note that the quotes in this example are not part of the formatting but used to show the whitespace padding.

The format specifiers in HyperStudy conform to conventional syntax. A more detailed explanation on the syntax can be found in references on computer programming.