Am 19.04.2017 um 15:25 schrieb Fabrice Couvreur:
I do not know Lua but I'll learn later. How to display only 3 digits after the decimal point ?
The default is 3 digits \startluacode function round(a,dec) local dec = dec or 3 local b = math.pow(10,dec) return math.floor(a*b)/b end \stopluacode \starttext \startlinecorrection[blank] \startmidaligned \bTABLE[width=2cm,offset=0.8ex,align={lohi,middle}] \bTR \bTD \math{P} \eTD \bTD \math{m} \eTD \bTD \math{g_M} \eTD \eTR \bTR \bTD \math{1.6} \eTD \bTD \math{0.4} \eTD \bTD \startluacode context(round(1.6/0.4,1))\stopluacode \eTD \eTR \bTR \bTD \math{3.1} \eTD \bTD \math{0.8} \eTD \bTD \startluacode context(round(3.1/0.8))\stopluacode \eTD \eTR \bTR \bTD \math{4.3} \eTD \bTD \math{1.2} \eTD \bTD \startluacode context(round(4.3/1.2,2)) \stopluacode \eTD \eTR \bTR \bTD \math{5.8} \eTD \bTD \math{1.6} \eTD \bTD \startluacode context(5.8/1.6)\stopluacode \eTD \eTR \bTR \bTD \math{7.5} \eTD \bTD \math{2} \eTD \bTD \startluacode context(7.5/2)\stopluacode \eTD \eTR \eTABLE \stopmidaligned \stoplinecorrection \stoptext Herbert