Trailing Zero Suppression

Richard Harrison harrison at all-auctions.com
Thu Apr 4 09:56:01 EST 2002


on 4/4/2002 4:03 AM, Chipp Walters at chipp at chipp.com wrote:

> Rick,
> 
> Try this (or someting like it)
> 
> on mouseUp
> put killTrail(5123.54001000)
> end mouseUp
> 
> function killTrail val
> if val contains "." then
> if last char of val is in "123456789." then
> return val
> else
> delete last char of val
> return killTrail(val)
> end if
> else
> return "no decimal number here"
> end if
> end killTrail

Chipp,

Thanks for the info.

I'm thinking that Michael Mays following solution
might be a little better.

> set the numberFormat to ".#######"
> put "1.23000000"+0
> 
> would display 1.23
> 
> michael

Thanks anyway, I appreciate the effort!

Rick Harrison




More information about the use-livecode mailing list