diff options
Diffstat (limited to 'tex/context/base/l-dimen.lua')
-rw-r--r-- | tex/context/base/l-dimen.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tex/context/base/l-dimen.lua b/tex/context/base/l-dimen.lua index 5b8a5c3df..35fca56da 100644 --- a/tex/context/base/l-dimen.lua +++ b/tex/context/base/l-dimen.lua @@ -19,6 +19,7 @@ local format, match, gsub, type, setmetatable = string.format, string.match, str local P, S, R, Cc, lpegmatch = lpeg.P, lpeg.S, lpeg.R, lpeg.Cc, lpeg.match number = number or { } +local number = number number.tonumberf = function(n) return match(format("%.20f",n),"(.-0?)0*$") end -- one zero too much but alas number.tonumberg = function(n) return format("%.20g",n) end |