>  Docs Center  >  Libraries  >  Daithi  >  STR

STR

STR

Name


STR

Purpose


This function converts an integer or floating point number to a string.

Category


Strings

Calling Sequence


Result = STR( Value [,Ndecplace] )

Inputs


Value: A scalar or array of numbers, of type integer or floating
point.

Optional Inputs


Ndecplace: The number of decimal places to round to in the output
string.

Keyword Parameters


FILLER: The filler character to use to fill in extra places when
LENGTH is defined. The default is a blank space.
LENGTH: The number of characters in the output string. The function
fills extra places with FILLER to satisfy this.

Outputs


Result: A string containing the number(s) Value.

Uses


DIMENSION.pro
VAR_TYPE.pro

Procedure


This function uses IDL's STRING function, but adds the ability to set
the number of decimal places.

Example


Convert 1.23456 to a string with 2 decimal places.
result = str( 1.23456, 2 )
Result should be '1.23'

Modification History


  Written by: Daithi A. Stone, 2000-07-11.
Modified: DAS, 2000-08-29 (killed place holder bug).
Modified: DAS, 2006-02-17 (added FILLER keyword)



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us