From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
Pablo Rodriguez <oinos@gmx.es>
Subject: Re: integer displayed as .0 float in Lua-5.3
Date: Thu, 9 Aug 2018 20:12:46 +0200 [thread overview]
Message-ID: <5f17db96-6e6f-893e-439a-4d4d5b4b8952@gmail.com> (raw)
In-Reply-To: <cef6e1b1-eee2-7983-3901-3d5641be7911@gmx.es>
Use tonumber.
%%%%%%
\starttext
\cldcontext{\lastpage + 1}
\cldcontext{"\lastpage" + 1}
\cldcontext{tonumber("\lastpage") + 1}
\stoptext
%%%%%%
Wolfgang
Pablo Rodriguez schrieb am 09.08.18 um 20:02:
> Dear list,
>
> I have the following sample
>
> \starttext
> \startTEXpage[offset=1em]
> Pages: \ctxlua{context([[\lastpage]])}.
>
> Next page: \ctxlua{context([[\lastpage]] + 1)}.
>
> (Lua \luaversion)
> \stopTEXpage
> \stoptext
>
> With Lua-5.2 (ConTeXt with JIT), I get the expected results. But with
> Lua-5.3 (standard ConTeXt), I get 2.0 as the value for the next page.
>
> I’m afraid that there is a bug here. I was told that the integer type
> has been introduced in Lua-5.3.
>
> I had experienced the same issue with the handlecsv module. In my very
> limited understanding of the issue, integers are displayed as .0 floats.
> I wonder which would be the way to fix it.
>
> Is this a real bug or am I missing something?
>
> Many thanks for your help,
>
> Pablo
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2018-08-09 18:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-09 18:02 Pablo Rodriguez
2018-08-09 18:12 ` Wolfgang Schuster [this message]
2018-08-09 19:20 ` Pablo Rodriguez
2018-08-09 19:34 ` Alan Braslau
2018-08-09 20:00 ` Pablo Rodriguez
2018-08-09 20:16 ` Alan Braslau
2018-08-11 9:29 ` Pablo Rodriguez
2018-08-11 17:55 ` Alan Braslau
2018-08-12 14:44 ` Arthur Reutenauer
2018-08-09 20:25 ` Hans Hagen
2018-08-11 10:05 ` Pablo Rodriguez
2018-08-09 20:20 ` Hans Åberg
2018-08-11 9:33 ` Pablo Rodriguez
2018-08-11 12:21 ` Hans Åberg
2018-08-12 7:49 ` Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f17db96-6e6f-893e-439a-4d4d5b4b8952@gmail.com \
--to=wolfgang.schuster.lists@gmail.com \
--cc=ntg-context@ntg.nl \
--cc=oinos@gmx.es \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).