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

Home » Public Forums » archive » Format code to trim leading zeroes?
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
Format code to trim leading zeroes? [message #81243] Mon, 27 August 2012 22:10 Go to next message
A J is currently offline  A J
Messages: 11
Registered: February 2012
Junior Member
I am not sure this can be done easily, but I was looking for some way
to format numbers in order to return the number without leading zeroes
or the decimal. For example,

if I have

0.003508

I want to return

3508

I have been playing with the format codes and strsplit but nothing has
worked quite right. I am thinking I could write a little program to
feed the number into a string array and run a few steps on the array
such that once the array value no longer equals '0' or '.', it stops
and returns whatever is left. However, before I go down this road, I
thought it might be wise to ask if this is the best/only way to do it.

Thanks.
Re: Format code to trim leading zeroes? [message #81381 is a reply to message #81243] Sun, 09 September 2012 21:25 Go to previous message
A J is currently offline  A J
Messages: 11
Registered: February 2012
Junior Member
Thankyou both. Actually both of these methods will work, for different purposes I have. Thanks solving two sides of a puzzle I have!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: structure arrays with different structures
Next Topic: Can't launch IDL DE anymore...

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

Current Time: Wed Oct 08 19:28:38 PDT 2025

Total time taken to generate the page: 0.00479 seconds