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

Home » Public Forums » archive » Re: How to eliminate trailing zeros in a string?
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: How to eliminate trailing zeros in a string? [message #33800 is a reply to message #33798] Sat, 25 January 2003 03:59 Go to previous messageGo to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
K Banerjee wrote:
> Folks,
>
> Say I have the string "20.304000". How can I eliminate the last 3
> zeros?
>
> Thanks.
>
> K. Banerjee
>

How about this one:

s=inputString
b=byte(s)
i=max(where(b ne 48))
trim=string(b[0:i])

This won't work with multiple of 10 integers (when no decimal point
is there).
BTW: Is there a specification, that the where function gives its result
always in ascending order?

cheers,
marc
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDLgrWindow, IDLgrVolume and alpha channel
Next Topic: MOUSE (WHEEL) BUTTON NON-STOP SCROLLING IN IDL 5.6

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

Current Time: Sat Oct 11 02:23:12 PDT 2025

Total time taken to generate the page: 0.64042 seconds