topstrsci
String
Parameters
data
in
required
Keywords
POT_ONLY
MANTISSA_ONLY
SHORT
TRIM
Examples
IDL> Result = STRSCI( 2000000, format='(i1)' )
IDL> print, result
2 x 10!u6!n
which gets plotted as 2 x 10
IDL> Result = STRSCI( -0.0001 )
IDL> print, result
-1.00 x 10!u-4!n
which gets plotted as 1.00 x 10
IDL> Result = STRSCI( 0d0, format='(f13.8)' )
IDL> print, result
0.00000000
Version history
Version
$Id: strsci.pro 374 2008-08-08 15:12:27Z pinsard $
Copyright (C) 1998, 1999 Bob Yantosca and Martin Schultz,
Harvard University
This software is provided as is without any warranty
whatsoever. It may be freely used, copied or distributed
for non-commercial purposes. This copyright notice must be
kept with any copy of this software. If this software shall
be used commercially or sold as part of a larger package,
please contact the author to arrange payment.
Bugs and comments should be directed to bmy@io.harvard.edu
or mgs@io.harvard.edu with subject "IDL routine strsci"
History
bmy, 28 May 1998: VERSION 1.00 B
- now returns string of the form A x 10
mgs, 29 May 1998:
- bug fix: now allows negative numbers
- keyword MANTISSA_ONLY added
- default format changed to f12.2
bmy, 02 Jun 1998:
- renamed to STRSCI ("STRing SCIentific notation"),
mgs, 03 Jun 1998:
- added TRIM keyword
mgs, 22 Sep 1998:
- added SHORT keyword
- modified handling of TRIM keyword
mgs, 24 Sep 1998:
- bug fix with SHORT flag
bmy & mgs, 02 Jun 1999:
- now can handle DATA=0.0 correctly
- updated comments
mgs, 03 Jun 1999:
- can now also handle values lt 1 ;-)
- and doesn't choke on arrays
Known issues
Restrictions
This function does not "evaluate" the format statement thoroughly
which can result in somewhat quirky strings. Example:
print,strsci(-9.999) results in -10.0x10^0 instead of -1.0x10^1.
Need a better symbol than the 'x' for the multiplier...
Statistics
McCabe cyclic | 15 |
McCabe essential | 1 |
McCabe modular design | 1 |