Ahoi, since i recently updated my ConTeXt beta, Lua function string.format 
behaves differently, i.e. type checks are stricter.
I guess it’s due to switching to Lua 5.3 in LuaTeX?

E.g. this:

  if tonumber(string.format('%d', value)) == value then ...

throws

  bad argument #2 to 'format' (number has no integer representation)

Since I just need to check if the number is integer, this works:

  if tonumber(value) == math.floor(value) then ...


This also affects Peter Münster’s grph-downsample module; please find a fixed 
version attached.
(Decimal pixel sizes make no sense anyway, so I just "floored" them.)

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

Attachment: grph-downsample.lua
Description: Binary data

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to