comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to print 100 in exponential format as '10^2'
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How to print 100 in exponential format as '10^2' [message #53955] Fri, 11 May 2007 03:16
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
On May 11, 6:53 am, "dux...@gmail.com" <dux...@gmail.com> wrote:
> Using format code '(e)', I can print 100 as '1.00e+002'.
> But I want to print it in exponential format as '10^2' and 2 is
> superscript for 10.

Where do you want to print it like this? In a graph, of to a text file/
terminal?

The easiest bet are the strsplit, and string functions:

dum = string(format='(e)', 100)
parts = strsplit(dum, 'e', /extract)
out = strcompress(string(format='(f,"x10^",i)', parts[0], parts[1]))

You may want to investigate textoidl if you want those numbers to
appear in graphical output.

Maarten
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: mpfit: multivariate fit
Next Topic: Needed Immediately: Competent attorney with in-depth experience in Fraud

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:07:33 PDT 2025

Total time taken to generate the page: 0.00472 seconds