Inhalt

Index

STR

STR converts a numeric value to a string and returns the string value. There are 2 variations of the STR command: with the first one you can define the total number of characters and the number of characters after the floating point. With the second variation you can define the format in detail and also convert the result to another unit (e.g. m to inch).

Syntax

STR (numeric_expression, length, fractions)

or:

STR (format_string, numeric_expression)

Parameter

numeric_expression: any numeric expression.

length (integer, ¹ 0): total number of characters.

fractions (integer, 0 £ fractions < length): number of characters after the floating point.

format_string: with format_string the result can be formatted in detail. The syntax is:

%[0 or more flags][length][.decimal_place] conv_spec

The parameters are as below:

%: obligatory

flags (for m, mm, cm, e, df, di, sqm, sqcm, sqf, sqi, dd, gr, rad, cum, l, cucm, cumm, cuf, cui, cuy, gal):

(none): right aligned (default)

-: left aligned

+: explicit plus sign for values > 0

space: blanks in place of a + sign for values > 0

flags (for m, mm, cm, df, di, sqm, sqcm, sqf, sqi, dd, fr, rad, cum, l, cucm, cumm, cuf, cui, cuy, gal):

#: don't display 0 wholes

flags (for ffi, fdi, fi):

0: display 0 inches

flags (for m, mm, cm, fdi, df, di, sqm, sqcm, sqf, sqi, dd, fr, rad, cum, l, cucm, cumm, cuf, cui, cuy, gal):

~: hide 0 decimals (effective only if the '#' flag is not specified)

^: do not change decimal separator and digit grouping characters (if not specified, these characters will be replaced as set in the current system)

length: unsigned decimal integer, the minimum number of characters to generate

decimal_place: the number of decimal places

conv_spec (conversion specifier):

e: exponential format (meter)

m: meters

mm: millimeters

cm: centimeters

ffi: feet and fractional inches

fdi: feet and decimal inches

df: decimal feet

fi: fractional inches

di: decimal inches

for areas:

sqm: square meters

sqcm: square centimeters

sqmm: square millimeters

sqf: square feet

sqi: square inches

for angles:

dd: decimal degrees

dms: degrees, minutes, seconds

gr: grads

rad: radians

surv: surveyors unit

for volumes:

cum: cubic meters

l: liters

cucm: cubic centimeters

cumm: cubic millimeters

cuf: cubic feet

cui: cubic inches

cuy: cubic yards

gal: gallons

Remarks

Usable since script version 1.1 (Allplan 2012-1).



Allplan

(C) ALLPLAN GmbH

Privacy policy