juh+ntg-context--- via ntg-context schrieb am 15.10.2024 um 21:37:
Am 15.10.24 um 17:16 schrieb Hans Hagen via ntg-context:
local sum = string.format("%0.2f", (0.3 * 100))
Gives 30.00
how do I get 30,00
local sum = string.formatters["%0.2M"](0.3 * 100)
Thanks a lot, Hans.
I can't find "string.formatters" and the format string %0.2M online or
in the Lua-Manual. Any hint where I can find more about this? As
commas as decimal separator might be a common wish, I would like to
document it somewhere in the Wiki, if I could find some context.
The function is documented in the "Context Lua documents" (cld-mkiv.pdf)
manual.
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________