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

Home » Public Forums » archive » Re: handling numbers
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: handling numbers [message #33177] Fri, 13 December 2002 09:30 Go to previous message
Richard Adams is currently offline  Richard Adams
Messages: 9
Registered: January 2000
Junior Member
> Hi!
> I am stuck on a problem, probably it is very easy, but I don't know the
> solutions!
>
> I have a list of number in this form:
>
> 000237.9
> 000246.3
> 000257.0
> ........
>
> and I would like to write them in this form:
> 00 02 37.9
> 00 02 46.3
> 00 02 57.0
>
> Is there any command that can do this?
> Thank you very much!
> Steve

a = '000235.8'
print, (STREGEX(a, '(..)(..)(....)', /SUBEXPR, /extract))[1:*]
00 02 35.8

This does something like that.

Cheers, Richard.


--
Richard J Adams e: rja46@cam.ac.uk
Department of Anatomy t: +44 1223 333750
University of Cambridge f: +44 1223 333786
Downing Street
Cambridge, CB2 3DY
UK
[Message index]
 
Read Message
Read Message
Previous Topic: OSX: syntax coloring?
Next Topic: Re: Proper use of assoc

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

Current Time: Wed Oct 08 14:57:00 PDT 2025

Total time taken to generate the page: 0.00342 seconds