Hi Dan,

It really seems there is no easy way in Angular to change default currency parameters across the application as mentioned in Angular Wiki (https://www.angularjswiki.com/angular/angular-currency-pipe-formatting-currency-in-angular/) and further elaborated in a GitHub discussion (https://github.com/angular/angular/issues/25461).

However, the Angular Wiki page cited above mentions a workaround (with a code example):

"we can define our own custom Angular currency Pipe to do the same.

Create a new file called custom.currencypipe.ts file and add the below code to it. You can change the paramters as per your requirements."

If implemented in Evergreen, maybe the currency parameters could be changed in a single place?

Linda

On 5/20/19 9:38 PM, Daniel Wells wrote:
Hello Eva,

The AngularJS interfaces are using the built-in currency filter, which supplies a dollar sign by default.  More here:

https://docs.angularjs.org/api/ng/filter/currency

It does appear that the filter can specify a different symbol; it is fairly limited otherwise.  The newer Angular looks to be more robust in allowing locale-specific currency formatting options.

If you care mainly about the symbol, you should be able to change that by modifying each place that filter is used, but that doesn't seem very practical.  If that doesn't seem viable for you, we probably need to look at expanding how that filter is processed to allow for better optional behavior.  Tacking on a root variable similar to date formatting doesn't seem too terrible.

Hopefully someone with more direct knowledge will chime in and let us know there is already an easier way.

Sincerely,
Dan


On Mon, May 20, 2019 at 3:06 PM Cerninakova Eva <cer...@jabok.cz <mailto:cer...@jabok.cz>> wrote:


    Hi,

    The Czech Evergreen community hopes that during the summer we will
    be possible to move our libraries to the web client using
    Evergreen version 3.3. Therefore, we are currently working on
    testing and removing potential localization problems.

    Currently, we are dealing with currency setting in the web staff
    client patron billing interface.

    There was no currency symbol used in the patron billing interface
    in the XUL staff client.  This has changed with the new web
    client:  There is the "$" symbol  shown in the patron billing
    interface for each payment amount. However, we use the Czech
    currency, and the dollar symbol shown in the interface is quite
    confusing and does not provide an easy survey of the money summary
    to staff. Even greater complication is that the dollar symbol is
    also used on patron payment receipts (see the attachments). We
    need the currency symbol to be changed (or at least removed).

    From the receipt template
    (Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2),
    as well as from the billing interface, it is obvious, that a
    specific currency (particularly USD) is automatically inserted
    into the receipt or into the billing interface. E.g. "Total owed:
    {{xact.summary.total_owed | currency}}" is interpreted as
    something like "Total owed: $1.50". However, unfortunately It is
    not clear to us, where the USD currency comes from.

    We suppose there should be probably a similar setting for the
    currency as it is for the date + time format (which is possible to
    set in the Library settings editor and which occurs in the receipt
    template as {{xact.xact_start | date:$root.egDateAndTimeFormat}} )???

    Does anyone please have an idea how to set the currency value?
    (The fact that we can't use our own currency is a real web staff
    blocker for us )

    Thanks for any hint
    Eva








    ---
    Mgr. Eva Cerniňáková
    cer...@jabok.cz <mailto:cer...@jabok.cz>
    Tel. +420 211 222 409

    Knihovna Jabok
    http:/knihovna.jabok.cz <http://knihovna.jabok.cz>
    Tel.  +420 211 222 410
    Jabok - Vyšší odborná škola sociálně pedagogická a teologická
    Salmovská 8, 120 00 Praha 2

Reply via email to