[Koha] Notice ACQORDERS shows aqorders.listprice with six decimal places

Jonathan Druart jonathan.druart at bugs.koha-community.org
Mon Sep 23 20:35:37 NZST 2024


Use the "Price" template plugin

At the top of the template, add:
[%- USE Price -%]

Then:
[% order.listprice | $Price %]

Le ven. 20 sept. 2024 à 11:07, Michael Kuhn <mik at adminkuhn.ch> a écrit :
>
> Hi
>
> In database field "aqorders.listprice" is given with six decimal places,
> thus a price would look like: 40.100000
>
> To beautify this we have added the following in notice ACQORDERS which
> removed the last four decimal places
>
>   [% "<<aqorders.listprice>>" FILTER remove('\d{4}$') %]
>
> so the price would look like: 40.10
>
> Since the update to Koha 24.05.01 this does not work anymore, instead it
> shows again: 40.100000
>
> We have also tested the following regex (which should limit the decimal
> places to two), but to no avail:
>
>   [% "<<aqorders.listprice>>" FILTER remove('^(\d+\.\d{2})\d+$') %]
>
> Is there a way to get rid of the unwanted decimal places in the notices
> of Koha 24.05?
>
> Best wishes: Michael
> --
> Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis
> Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz
> T 0041 (0)61 261 55 61 · E mik at adminkuhn.ch · W www.adminkuhn.ch
> _______________________________________________
>
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha


More information about the Koha mailing list