From b6f3607dc714f59744fa7dc622dfccd9a8f272c8 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Wed, 14 Jan 2026 22:48:03 -0700 Subject: [PATCH] Add new currency functions --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index abf450f..6ed1292 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,10 @@ PostalPoint uses the Jimp library version 1.6 for creating and manipulating imag * `country()`: Returns the 2-character country code that PostalPoint is running in (examples: "US", "CA"). * `currency()`: Returns the 3-character currency code (examples: "usd", "cad"). * `symbol()`: Returns the currency symbol (example: "$"). +* `decimals()`: Returns the number of decimal places for the currency (2 for USD 0.00, etc) +* `async convertCurrency(amount = 1.0, fromCurrency = "usd", toCurrency = global.apis.i18n.currency())`: Convert an amount of money to a different currency. Conversion rate is retrieved from the cloud service and cached for 4 hours. +* `moneyToFixed(amount)`: Returns the amount as a string with the correct number of decimal places. Same as running `amount.toFixed(global.apis.i18n.decimals())`. +* `moneyString(amount)`: Returns the money amount formatted as a string with currency symbol. Same as running `global.apis.i18n.symbol() + amount.toFixed(global.apis.i18n.decimals())`. #### Kiosk