ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] max function in spreadsheettable
@ 2024-10-15  8:59 juh+ntg-context--- via ntg-context
  2024-10-15 10:42 ` [NTG-context] " Henning Hraban Ramm
  0 siblings, 1 reply; 11+ messages in thread
From: juh+ntg-context--- via ntg-context @ 2024-10-15  8:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: juh+ntg-context

Dear all,

I have a cell that calculates a value that may not be a negative value. 
If it is a negatiive value the cell should show zero.


\startcell[style=normal]
@ "0.2f EUR" $pauschale.eintag$ - ((D[row] * (0.2  * 
$pauschale.vororttag$)) + (E[row] * (0.4  * $pauschale.vororttag$)) + 
(F[row] * (0.4  * $pauschale.vororttag$)))
\stopcell

The $-variables will get resolved by Pandoc before ConTeXt comes into play.

As far as I understood the handdbook spreadsheets-mkiv.pdf it is 
possible to define lua functions inside a cell.

Who would you implement a max function that sets the value to 0 if it is 
negative?

TIA
juh

P.S. For German speakers: We try to implement a Reisekostenformular.
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-11-14 18:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-15  8:59 [NTG-context] max function in spreadsheettable juh+ntg-context--- via ntg-context
2024-10-15 10:42 ` [NTG-context] " Henning Hraban Ramm
2024-10-15 12:33   ` juh+ntg-context--- via ntg-context
2024-10-15 15:16     ` Hans Hagen via ntg-context
2024-10-15 19:37       ` juh+ntg-context--- via ntg-context
2024-10-15 19:58         ` Wolfgang Schuster
2024-10-16  5:43           ` juh+ntg-context--- via ntg-context
2024-10-15 20:04         ` Henning Hraban Ramm
2024-11-14  7:59       ` [NTG-context] string.formatters (was: Re: max function in spreadsheettable) juh+ntg-context--- via ntg-context
2024-11-14  8:18         ` [NTG-context] Re: string.formatters juh+ntg-context--- via ntg-context
2024-11-14 18:23           ` Wolfgang Schuster

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).