When you enter units within an input field for an element, you can do so by simply inserting them after the values in your expression:
You must, however, abide by several rules to ensure that the expression you enter can be unambiguously interpreted by GoldSim:
• Within a unit string, you cannot have any spaces. For example, meters per second must be entered as m/s rather than m / s.
• In general, you should enter a space after each unit string. In some cases, this space is required to ensure that the expression can be unambiguously interpreted (e.g., if the unit string is followed by a subtraction or division). In other cases, even if GoldSim is able to unambiguously interpret the expression, it is good practice to add a space after unit strings to make the expression more readable.
You can also explicitly identify the units by enclosing them in braces:
Braces are not required, but they can help make expressions more readable. Moreover, when you use them, it is not necessary to abide by the two rules mentioned above.
Note: Braces can only be used in an element's input fields. You can not use braces when defining the display units for an element.
In general, you only append unit strings to numbers. You should never append a unit string to an output name (a link) which itself has dimensions (this will result in a warning message). You can, however, append units to an output name or expression if the output or expression is dimensionless:
A m + 4 ft |
OK if and only if A is dimensionless |
(A*B) ft |
OK if and only if (A*B) is dimensionless |