format

From DavinciWiki
Jump to: navigation, search


64-bit SafeYes

Description

Show or change an objects data type.

Identical to type

Arguments and Return Values

Arguments: a numeric array

Return Value: string containing data format/type

Usage

Syntax: format(object = VAL [, format = BYTE/SHORT/INT/FLOAT/DOUBLE])

The format() function reports or changes the data format of an object. If used with only one argument, the data format of the object specified by the argument is reported as a string. The return values are one of:

  • "byte" - 8 bit unsigned integer
  • "short" - 16 bit signed integer
  • "int" - 32 bit signed integer
  • "float" - 32 bit real
  • "double" - 64 bit real
  • "STRING"
  • "TEXT"
  • "STRUCT"

If the second, optional, argument is included, the object specified bt the first argument is duplicated and converted to the specified format.

Examples

dv> a
4x3x1 array of float, bsq format [48 bytes]
0.947578        0.792789        0.507263        0.826081
0.772994        0.0223106       0.0498551       0.427454
0.428879        0.514308        0.264948        0.656318

dv> format(a)
"float"

dv> format(a,int)
4x3x1 array of int, bsq format [48 bytes]
0       0       0       0
0       0       0       0
0       0       0       0

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Core Changes

Modified On: 07-06-2009

Personal tools