Skip to content

Latest commit

 

History

History
59 lines (47 loc) · 1.44 KB

File metadata and controls

59 lines (47 loc) · 1.44 KB

Num2Str

Description

Function Num2Str converts a REAL value to a string and returns the value.

Parameter decPlace has a range of -1 to 9; if -1 is specified, the value will be returned in scientific notation.

FUNCTION Num2Str(
				decPlace : INTEGER;
				v        : REAL): STRING;
def vs.Num2Str(decPlace, v):
    return STRING

Parameters

Name Type Description
decPlace INTEGER Number of decimal places.
v REAL Numeric value.

Remarks

[[User:CBM-c-|c]], 2015.05.23: You can also use [[VS:Concat]] to convert numbers to strings, but it uses exclusively a dot "." as symbol for the decimal marker, because it outputs the number as seen from inside VS, I suppose. See further comments on the page [[VS:Concat]].

The parameter decPlace can be the following values: {| class="wikitable"

!Value !! Meaning !! Sample
positive
-
0
-
-1
-
-2
}

Examples

==== VectorScript ====

oldnumValue := 232.5148;
newStrValue := Num2Str(3, oldnumValue);
{ --> '232.515' if your system is american }
{ --> '232,515' if your system is metric }

==== Python ====

Version

Availability: from All Versions

Category

  • Strings