![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
Hans Hagen wrote: a better one local digit = lpeg.R("09") local period = lpeg.P(".") local zero = lpeg.P("0") local nozero = 1 - zero local finish = lpeg.P(-1) local nodigit = (1-digit) + finish local case_1 = (period * zero^1 * #nodigit)/"" -- .000 local case_2 = (period * (1-(zero^0/"") * #nodigit)^1 * (zero^0/"") * nodigit) -- .010 .10 .100100 local number = digit^1 * (case_1 + case_2) local stripper = lpeg.Cs((number + 1)^0) function aux.strip_zeros(str) return stripper:match(str) end ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------