From 99dc1cd9bb77ac9fa68b0584f58f57749994fdba Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 7 Feb 2019 19:16:06 +0100 Subject: 2019-02-07 18:55:00 --- tex/context/base/mkiv/util-str.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tex/context/base/mkiv/util-str.lua') diff --git a/tex/context/base/mkiv/util-str.lua b/tex/context/base/mkiv/util-str.lua index 410a4a547..713c294eb 100644 --- a/tex/context/base/mkiv/util-str.lua +++ b/tex/context/base/mkiv/util-str.lua @@ -612,6 +612,8 @@ local environment = { formattedfloat = number.formattedfloat, stripzero = lpeg.patterns.stripzero, stripzeros = lpeg.patterns.stripzeros, + + FORMAT = string.f9, } -- -- -- @@ -730,6 +732,17 @@ local format_F = function(f) -- beware, no cast to number end end +-- if string.f9 then +-- format_F = function(f) -- beware, no cast to number +-- n = n + 1 +-- if not f or f == "" then +-- return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or FORMAT(a%s))",n,n,n,n,n) +-- else +-- return format("((a%s %% 1 == 0) and format('%%i',a%s) or FORMAT(a%s,'%%%sf'))",n,n,n,f) +-- end +-- end +-- end + local format_k = function(b,a) -- slow n = n + 1 return format("formattedfloat(a%s,%i,%i)",n,b or 0, a or 0) -- cgit v1.2.3