mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 22:01:49 +03:00
67bf3a77c1
refs https://github.com/TryGhost/Team/issues/472 The current `{{price}}` helper only works with `amount` to convert it into right value but doesn't allow any formatting with currency etc, leaving most of the work to theme. We want to be able to output well formatted prices. E.g. the API returns 5000 for 5 EUR but we want to output €5. The updated {{price}} helper can take a plan object or plan amount currency and use them to output a well formatted price. It works with JS's built in Intl.NumberFormat behaviour to return output in different formats, also allowing theme devs to override formatting with options. Examples: With Plan object => `{{price plan}} → "€5"` With Plan object and custom number format => `{{price plan numberFormat="long"}} → "€5.00"` Output only currency symbol => `{{price currency='EUR'}} → "€"` |
||
---|---|---|
.. | ||
api-acceptance | ||
frontend-acceptance | ||
regression | ||
unit | ||
utils | ||
.eslintignore | ||
.eslintrc.json | ||
.jshintrc |