num2Str Function

Converts a real number to a text string.

NoteNote

MorphX replaces any invalid parameter with a standard value.



str num2Str(
    real number,
    int character,
    int decimals,
    int separator1,
    int separator2)

Parameter

Description

number

The number to convert to a text string.

character

The minimum number of characters required in the text.

decimals

The required number of decimals.

separator1

The decimal separator.

Possible values:

  • 1 – point (.)

  • 2 – comma (,)

separator2

The thousands separator.

Possible values:

  • 0 – no thousands separator

  • 1 – point (.)

  • 2 – comma (,)

  • 3 – space ( )

A text string that represents the number.

// Returns 12.345,60.
num2Str(12345.6,10,2,2,1);
 
// Returns 12345.
num2Str(12345.6,1,0,1,0);

Community Additions

ADD
Show: