On Tue, 20 Jan 2009 13:19:41 -0800 (PST)
·········@yahoo.com wrote:
> Ruby:
>
> format( "%.3f", 8.2 ).sub( /0?0$/, "" )
> ==>"8.2"
> format( "%.3f", 8.0 ).sub( /0?0$/, "" )
> ==>"8.0"
> format( "%.3f", 8.55 ).sub( /0?0$/, "" )
> ==>"8.55"
Though I doubt that the original poster asked for a Ruby solution in
comp.lang.lisp. Using regular expressions is possible in Lisp, too.
regards,
Marek