topstrsci
String
Parameters
Data
in
required
Keywords
POT_Only
MANTISSA_ONLY
SHORT
TRIM
Examples
Result = STRSCI( 2000000, format='(i1)' )
print, result
; 6
; prints 2 x 10!u6!n, which gets plotted as 2 x 10
Result = STRSCI( -0.0001 )
print, result
; 4
; prints -1.00 x 10!u-4!n, which gets plotted as 1.00 x 10
Result = STRSCI( 0d0, format='(f13.8)' )
print, result
;
; prints, 0.00000000
Version history
Version
$Id: strsci.pro 157 2006-08-21 09:01:50Z navarro $
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 |